1. Next Permutationhistorical

    Implement a function that obtains the next permutation. The algorithm must rearrange the given sequence of numbers into the next lexicographically greater permutation.

  2. Permutationshistorical

    Given a sequence of distinct numbers, return all possible permutations.

  3. Subsetshistorical

    Given an integer array nums whose elements are all distinct, return all possible subsets (the power set).

  4. Unique Pathshistorical

    A robot starts at the top-left corner of an m × n grid and can move only down or right. Count the paths to the bottom-right corner.

  5. Number of Islandshistorical

    Given a 2D grid consisting of '1' (land) and '0' (water), calculate the number of islands in the grid.

  6. Maximal Squarehistorical

    In a 2D matrix consisting of '0' and '1', find the largest square containing only '1' and return its area.

  7. Partition Equal Subset Sumhistorical

    Given a non-empty array containing only positive integers, determine whether the array can be partitioned into two subsets whose sums are equal.

  8. Perfect Squareshistorical

    Given a positive integer n, find several perfect-square numbers (such as 1, 4, 9, 16, ...) whose sum equals n. You need to minimize the number of perfect squares used.

  9. Target Sumhistorical

    Assign a plus or minus sign to each number in a nonnegative integer array and count the assignments whose sum equals the target S.

  10. Combination Sumhistorical

    Given an array candidates containing no duplicate elements and a target number target, find all combinations of numbers in candidates whose sum equals target.

  11. Coin Changehistorical

    Given coins of different denominations and a total amount, write a function to compute the minimum number of coins needed to make up that amount. If no combination of coins can make up the amount, return -1.

  12. Burst Balloonshistorical

    Each balloon carries a number, and bursting it earns points based on its neighbors. Choose a bursting order that maximizes the total score.

  13. House Robberhistorical

    You are a professional robber planning to rob houses along a street. Each house contains some cash. The only constraint is that adjacent houses have connected security systems, and the alarm will automatically trigger if two adjacent houses are broken into on the same night.

  14. Best Time to Buy and Sell Stock with Cooldownhistorical

    Given daily stock prices, find the maximum trading profit when selling a stock requires a one-day cooldown before buying again.

  15. Minimum Path Sumhistorical

    Given an m x n grid of non-negative integers, find a path from the top-left corner to the bottom-right corner such that the sum of the numbers along the path is minimized.

  16. Longest Increasing Subsequencehistorical

    Given an integer array nums, find the length of the longest strictly increasing subsequence.

  17. Jump Gamehistorical

    Each element of a nonnegative integer array gives the maximum jump length from that position. Determine whether the last position is reachable.