![JAR search and dependency download from the Maven repository](/logo.png)
g2601_2700.s2683_neighboring_bitwise_xor.Solution.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-kotlin Show documentation
Show all versions of leetcode-in-kotlin Show documentation
Kotlin-based LeetCode algorithm problem solutions, regularly updated
package g2601_2700.s2683_neighboring_bitwise_xor
// #Medium #Array #Bit_Manipulation #2023_07_28_Time_988_ms_(100.00%)_Space_76.1_MB_(100.00%)
class Solution {
fun doesValidArrayExist(derived: IntArray): Boolean {
var xor = 0
for (j in derived) {
xor = xor xor j
}
return xor == 0
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy