TLE for input:
So leetcode added more test case?
This should be upvoted more. So concise and easy to understand. The top voted answers are so complicated IMHO.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.