Sometimes the 'top-voted' solution in Leetcode is too clever and not very instructive
What I mean is, the top voted answer may be the most optimized, but it does not fit into any common patterns (ie, DFS, BFS, Recursive backtracking, union find, sliding window, two pointer, etc). Instead it relies on some 'one-off', albeit smart observation about the problem. There's nothing in those