Skip to content

Commit

Permalink
add sol
Browse files Browse the repository at this point in the history
  • Loading branch information
ductnn committed Jan 17, 2025
1 parent b2759cf commit 920d1ae
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions leetcode/daily/2683/sol.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://leetcode.com/problems/neighboring-bitwise-xor/

package main

func doesValidArrayExist(derived []int) bool {
xor := 0
for _, d := range derived {
xor ^= d
}

return xor == 0
}

func main() {
derived := []int{1, 1, 0}
println(doesValidArrayExist(derived))
}

0 comments on commit 920d1ae

Please sign in to comment.