650. 2 Keys Keyboard
There is only one character ‘A’ on the screen of a notepad. You can perform one of two operations on this notepad […]
There is only one character ‘A’ on the screen of a notepad. You can perform one of two operations on this notepad […]
An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return the nth ugly number. Example 1: Input:
You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the
You are given m arrays, where each array is sorted in ascending order. You can pick up two integers from two different arrays
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one
The distance of a pair of integers a and b is defined as the absolute difference between a and b. Given an integer array nums and an integer k, return the kth smallest distance among all
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order,
You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-directionally (horizontal or vertical) connected group of 1‘s. The grid
An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a ‘/’, ‘\’, or blank space ‘ ‘. These
A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all
You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and