Skip to content

Commit 2a097e0

Browse files
committed
Jan 17
1 parent 826fc77 commit 2a097e0

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from typing import List
2+
3+
4+
class Solution:
5+
def doesValidArrayExist(self, derived: List[int]) -> bool:
6+
# return not reduce(xor, derived)
7+
return not sum(derived) & 1
8+
9+
10+
def main():
11+
derived = [1, 1, 0]
12+
assert Solution().doesValidArrayExist(derived) is True
13+
14+
derived = [1, 1]
15+
assert Solution().doesValidArrayExist(derived) is True
16+
17+
derived = [1, 0]
18+
assert Solution().doesValidArrayExist(derived) is False
19+
20+
21+
if __name__ == '__main__':
22+
main()

2025-01-January-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| January 14 | [2657. Find the Prefix Common Array of Two Arrays](https://leetcode.com/problems/find-the-prefix-common-array-of-two-arrays/) | Medium | Solved |
2020
| January 15 | [2429. Minimize XOR](https://leetcode.com/problems/minimize-xor/) | Medium | Unsolved |
2121
| January 16 | [2425. Bitwise XOR of All Pairings](https://leetcode.com/problems/bitwise-xor-of-all-pairings/) | Medium | Solved |
22-
| January 17 | []() | | |
22+
| January 17 | [2683. Neighboring Bitwise XOR](https://leetcode.com/problems/neighboring-bitwise-xor/) | Medium | Solved |
2323
| January 18 | []() | | |
2424
| January 19 | []() | | |
2525
| January 20 | []() | | |
@@ -40,5 +40,5 @@
4040
| Level | Problems | Solved | Unsolved |
4141
| --- | --- | --- | --- |
4242
| Easy | 4 | 4 | 0 |
43-
| Medium | 12 | 10 | 2 |
43+
| Medium | 13 | 11 | 2 |
4444
| Hard | 0 | 0 | 0 |

0 commit comments

Comments
 (0)