Skip to main content

9 docs tagged with "Array"

View All Tags

Buy and Sell Stock 3

Say you have an array for which the ith element is the price of a given stock on day i.

Buy and Sell Stocks 1

Say you have an array for which the i-th element is the price of a given stock on day i.

Buy and Sell Stocks 2

Say you have an array for which the i-th element is the price of a given stock on day i.

Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).

Sum of the 3 Closest

Given an array nums of n integers 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.

Sum of the 3 Zero

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.

Sum of the 4

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