Mind Map
Solution 1 & Solution2
Code
Solution 1 & Solution 2
The Non-bruteforece Solution
Solution
Algorithm
Solution1 (Quadratic time complexity)
Solution2 (Linear time complexity)