Algorithms And Data Structures For Leetcode 150