Created
January 17, 2025 11:29
-
-
Save lbvf50mobile/384cc793dabaa443ed04fac91c5319e2 to your computer and use it in GitHub Desktop.
Leetcode: 2683. Neighboring Bitwise XOR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Leetcode: 2683. Neighboring Bitwise XOR | |
// https://leetcode.com/problems/neighboring-bitwise-xor/description/ | |
// = = = = = = = = = = = = = = | |
// Accepted. | |
// Thanks God, Jesus Christ! | |
// = = = = = = = = = = = = = = | |
// Runtime: 0 ms Beats 100.00% | |
// Memory: 13.31 MB Beats 11.11% | |
// 2025.01.17 Daily Challenge. | |
package main | |
import ( | |
// "fmt" | |
) | |
func doesValidArrayExist(derived []int) bool { | |
sum := 0 | |
for _, v := range derived { | |
sum ^= v | |
} | |
return 0 == sum | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment