0015 3Sum
Solved at: 230130 3Sum - LeetCode
Question
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Notice that the solution set must not contain duplicate triplets.
Solution
Results
- Time taken: 30 m 39 s
- Runtime 2424 ms, Beats 10.20%
- Memory 156.2 MB, Beats 6.9%
Complexity Analysis
for both, worst case. for both, worst case.
Backlinks (1)
Comments (0)