"Simplicity can't be bought later, it must be earned from the start" -- DB
public class Solution { public int XorOperation(int n, int start) { int xored = 0; for (var i = 0; i < n; ++i) { xored ^= start + 2 * i; } return xored; } }
No comments:
Post a Comment