Click here to see the full article post
@Aeonaxx I have updated it. THanks.
For the first approach's time complexity, better say O(4N) instead of redefining n (to what N already is).
Approach #2 is definitely wrong. We should do modulo operation on result. After modified, it'll still get TLE.
@Apolloliu I have updated the Approach #2. Its now AC. Thanks
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.