If you have a better solution, feel free to open a PR. Add a small summary of your solution with space and time complexities. Make sure your code passes all the test cases on LeetCode for the problem ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results