mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 03:11:41 +08:00
Add solution 1486
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
package leetcode
|
||||
|
||||
func xorOperation(n int, start int) int {
|
||||
res := 0
|
||||
for i := 0; i < n; i++ {
|
||||
res ^= start + 2*i
|
||||
}
|
||||
return res
|
||||
}
|
Reference in New Issue
Block a user