dynamic programming

Leetcode Unique Paths Java Solution

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only…

2 years ago

Leetcode Perfect Squares Java Solution

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum…

2 years ago

Leetcode Unique Binary Search Trees Java Solution

Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Input: 3 Output: 5 Explanation: Given n…

2 years ago

Leetcode Dungeon Game Java Solution

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists…

2 years ago

This website uses cookies.