# 49.leetcode题目18. 4Sum

Given an array S of n integers, are there elements abc, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.

Note:

• Elements in a quadruplet (a,b,c,d) must be in non-descending order. (ie, a ≤ b ≤ c ≤ d)
• The solution set must not contain duplicate quadruplets.

    For example, given array S = {1 0 -1 0 -2 2}, and target = 0.

A solution set is:
(-1,  0, 0, 1)
(-2, -1, 1, 2)
(-2,  0, 0, 2)

Line 3: stray ‘\357’ in program

accept，but~

• 本文已收录于以下专栏：

## 18. 4Sum LeetCode题解

Given an array S of n integers, are there elements a, b, c, and d in S such that a +&...

## leetcode 18. 4Sum

class Solution { public: vector> fourSum(vector& nums, int target) { vector> res; sort(nums.be...

## 【LeetCode】LeetCode——第18题：4Sum

【LeetCode】LeetCode——第18题：4Sum

## 18. 4Sum Leetcode Python

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = tar...

## leetcode 18 -- 4Sum

4Sum 题目：Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c...

## (LeetCode 18) 4Sum

Q: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d =...

举报原因： 您举报文章：深度学习：神经网络中的前向传播和反向传播算法推导 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)