18. 4Sum
思路: 思路同3sum, 先排序,分别对前两个遍历,后两个从两边逼近
O(n^3)
Python:
1 | class Solution: |
Go:
1 | func fourSum(nums []int, target int) [][]int { |
思路: 思路同3sum, 先排序,分别对前两个遍历,后两个从两边逼近
O(n^3)
Python:
1 | class Solution: |
Go:
1 | func fourSum(nums []int, target int) [][]int { |