Skip to main content

21 docs tagged with "Arrays"

View all tags

3Sum

Given an array of integers, find all unique triplets that sum to zero.

4Sum

Find all unique quadruplets in a given array of integers that sum up to a specific target value.

Best Time to Buy and Sell Stock

Given an array of stock prices for consecutive days, find the maximum profit that can be achieved by buying on one day and selling on a…

Binary Search

Given a sorted array of integers, find the index of a given target value.

Coin Change

Find the minimum number of coins to make a target amount, or return -1 if impossible

Contains Duplicate

Given an array of integers, determine if any number appears more than once.

Evaluate Reverse Polish Notation

Given an array of strings representing an arithmetic expression in Reverse Polish Notation (RPN), evaluate the expression and return the…

Insert Interval

Given a sorted list of non-overlapping intervals and a new interval, insert the new interval into the list while maintaining the sorted…

Longest Palindrome

Given a string composed of lowercase and uppercase English letters, determine the length of the longest possible palindrome that can be…

Majority Element

Given an array of integers, find the element that appears more than half the time.

Maximum Subarray

Given an array of integers, find the contiguous subarray with the largest sum and return its sum.

Merge Intervals

Merge overlapping intervals in a list and return the non-overlapping intervals that cover all inputs

Permutations

Find all possible arrangements of distinct integers in an array.

Product Of Array Except Self

Compute the product of all elements in an array except for the element at the current index, without using division.

Two Sum

Given an array of integers and a target integer, find the indices of two numbers that add up to the target.

Zigzag Conversion

Given a string and a number of rows, arrange the string in a zigzag pattern and then read it line by line to produce a new string.