This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
454. 4Sum II | |
Medium | |
2280 | |
85 | |
Add to List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that: | |
0 <= a, b, c, d < n | |
a, b, c, and d are distinct. | |
nums[a] + nums[b] + nums[c] + nums[d] == target | |
You may return the answer in any order. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
167. Two Sum II - Input array is sorted | |
Easy | |
Given an array of integers numbers that is already sorted in non-decreasing order, | |
find two numbers such that they add up to a specific target number. | |
Return the indices of the two numbers (1-indexed) as an integer array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
611. Valid Triangle Number | |
Medium | |
Given an integer array nums, return the number of triplets chosen | |
from the array that can make triangles if we take them as side | |
lengths of a triangle. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
259: 3Sum Smaller | |
Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < target. | |
For example, given nums = [-2, 0, 1, 3], and target = 2. | |
Return 2. Because there are two triplets which sums are less than 2: | |
[-2, 0, 1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
3Sum Closest | |
Medium | |
Given an integer array nums of length n and an integer target, | |
find three integers in nums such that the sum is closest to target. | |
Return the sum of the three integers. | |
You may assume that each input would have exactly one solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
149. Max Points on a Line | |
Hard | |
Given an array of points where points[i] = [xi, yi] represents a point | |
on the X-Y plane, return the maximum number of points that lie on the | |
same straight line. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
713. Subarray Product Less Than K | |
Medium | |
Given an array of integers nums and an integer k, | |
return the number of contiguous subarrays where the | |
product of all the elements in the subarray is strictly less than k. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1099. Two Sum Less Than K (https://leetcode.com/problems/two-sum-less-than-k/): | |
Given an array A of integers and integer K, return the maximum S such that there | |
exists i < j with A[i] + A[j] = S and S < K. If no i, j exist satisfying | |
this equation, return -1 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
628. Maximum Product of Three Numbers | |
Given an integer array nums, find three numbers whose product is maximum and return the maximum product. | |
Example 1: |
NewerOlder