Suraj Yadav
Suraj Yadav's Blog

Suraj Yadav's Blog

3 Sum - LeetCode

Dec 11, 20212 min read

The problem is taken from 15. 3Sum. Naive Approach Naive approach would be to go through all possible triplets in the array. And use set data structure to remove duplicates. Code - class Solution { public: vector<vector<int>> threeSum(vector<i...

3 Sum - LeetCode
Pascal's Triangle - LeetCode
Merge Sorted Array - LeetCode
Maximum Sum Contiguous Subarray - LeetCode
Search Insert Position - LeetCode
Remove Duplicates from Sorted Array - LeetCode