PROBLEM DESCRIPTION There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend...
Summary Ranges
PROBLEM DESCRIPTION You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all t...
Game of Life
PROBLEM DESCRIPTION According to Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.” The b...
Contains Duplicate II
PROBLEM DESCRIPTION Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k. leetcode ...
Word Pattern
PROBLEM DESCRIPTION Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty w...
Isomorphic Strings
PROBLEM DESCRIPTION Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character ...
Substring with Concatenation of All Words
PROBLEM DESCRIPTION You are given a string s and an array of strings words. All the strings of words are of the same length. A concatenated substring in s is a substring that contains all the stri...
Minimum Size Subarray Sum
PROBLEM DESCRIPTION Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no suc...
Insert Delete GetRandom O(1)
PROBLEM DESCRIPTION Implement the RandomizedSet class: RandomizedSet() Initializes the RandomizedSet object. bool insert(int val) Inserts an item val into the set if not present. Returns tru...
ZigZag Conversion
PROBLEM DESCRIPTION The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P ...