The first solution accounts for even number pairs, if the pairs are odd, then you won't get the right answer. lets take 5 ^ 5 = 0 or 5 ^ 5 ^ 5 ^ 5 = 0. 5 ^ 5 ^ 2 = 2.. if its odd. 5 ^ 5 ^ 5 ^ 2 = 7 not 2. watch my other video for more clarification • Leetcode: Single Number || Dart Langu... . Second solution is dynamic for any occurrence, but slower.
~-~~-~~~-~~-~
Please watch: "CSES problem #4: Increasing Array"
• CSES problem #4: Increasing Array
~-~~-~~~-~~-~