leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1486.cpp (202B)
0 class Solution { 1 public: 2 int xorOperation(int n, int start) { 3 int res = 0; 4 5 for (int i = 0; i < n; i++) { 6 res ^= start + 2 * i; 7 } 8 9 return res; 10 } 11 };