Dynamic Programming | LeetCode Problems

254 Dynamic Programming solutions to LeetCode solutions.

Dynamic Programming Problems View all solutions →

Longest Palindromic Substring

#5 Medium

Regular Expression Matching

#10 Hard

Generate Parentheses

#22 Medium

Longest Valid Parentheses

#32 Hard

Trapping Rain Water

#42 Hard

Wildcard Matching

#44 Hard

Jump Game II

#45 Medium

Maximum Subarray

#53 Easy

Jump Game

#55 Medium

Unique Paths

#62 Medium

Unique Paths II

#63 Medium

Minimum Path Sum

#64 Medium

Climbing Stairs

#70 Easy

Edit Distance

#72 Medium

Maximal Rectangle

#85 Hard

Scramble String

#87 Hard

Decode Ways

#91 Medium

Unique Binary Search Trees II

#95 Medium

Unique Binary Search Trees

#96 Medium

Interleaving String

#97 Medium

Distinct Subsequences

#115 Hard

Pascal's Triangle

#118 Easy

Pascal's Triangle II

#119 Easy

Triangle

#120 Medium

Best Time to Buy and Sell Stock

#121 Easy

Best Time to Buy and Sell Stock II

#122 Medium

Best Time to Buy and Sell Stock III

#123 Hard

Binary Tree Maximum Path Sum

#124 Hard

Palindrome Partitioning

#131 Medium

Palindrome Partitioning II

#132 Hard

Word Break

#139 Medium

Word Break II

#140 Hard

Maximum Product Subarray

#152 Medium

Dungeon Game

#174 Hard

Best Time to Buy and Sell Stock IV

#188 Hard

House Robber

#198 Medium

House Robber II

#213 Medium

Maximal Square

#221 Medium

Number of Digit One

#233 Hard

Different Ways to Add Parentheses

#241 Medium

Ugly Number II

#264 Medium

Perfect Squares

#279 Medium

Longest Increasing Subsequence

#300 Medium

Best Time to Buy and Sell Stock with Cooldown

#309 Medium

Burst Balloons

#312 Hard

Super Ugly Number

#313 Medium

Coin Change

#322 Medium

Longest Increasing Path in a Matrix

#329 Hard

House Robber III

#337 Medium

Counting Bits

#338 Easy

Integer Break

#343 Medium

Russian Doll Envelopes

#354 Hard

Count Numbers with Unique Digits

#357 Medium

Largest Divisible Subset

#368 Medium

Guess Number Higher or Lower II

#375 Medium

Wiggle Subsequence

#376 Medium

Combination Sum IV

#377 Medium

Is Subsequence

#392 Easy

Rotate Function

#396 Medium

Integer Replacement

#397 Medium

Frog Jump

#403 Hard

Split Array Largest Sum

#410 Hard

Arithmetic Slices

#413 Medium

Partition Equal Subset Sum

#416 Medium

Non-overlapping Intervals

#435 Medium

Arithmetic Slices II - Subsequence

#446 Hard

Poor Pigs

#458 Hard

Can I Win

#464 Medium

Count The Repetitions

#466 Hard

Unique Substrings in Wraparound String

#467 Medium

Concatenated Words

#472 Hard

Matchsticks to Square

#473 Medium

Ones and Zeroes

#474 Medium

Predict the Winner

#486 Medium

Zuma Game

#488 Hard

Target Sum

#494 Medium

Fibonacci Number

#509 Easy

Freedom Trail

#514 Hard

Longest Palindromic Subsequence

#516 Medium

Coin Change II

#518 Medium

Beautiful Arrangement

#526 Medium

01 Matrix

#542 Medium

Remove Boxes

#546 Hard

Student Attendance Record II

#552 Hard

Optimal Division

#553 Medium

Out of Boundary Paths

#576 Medium

Delete Operation for Two Strings

#583 Medium

Non-negative Integers without Consecutive Ones

#600 Hard

K Inverse Pairs Array

#629 Hard

Shopping Offers

#638 Medium

Decode Ways II

#639 Hard

Maximum Length of Pair Chain

#646 Medium

Palindromic Substrings

#647 Medium

2 Keys Keyboard

#650 Medium

Strange Printer

#664 Hard

Number of Longest Increasing Subsequence

#673 Medium

Valid Parenthesis String

#678 Medium

Knight Probability in Chessboard

#688 Medium

Maximum Sum of 3 Non-Overlapping Subarrays

#689 Hard

Stickers to Spell Word

#691 Hard

Partition to K Equal Sum Subsets

#698 Medium

Minimum ASCII Delete Sum for Two Strings

#712 Medium

Best Time to Buy and Sell Stock with Transaction Fee

#714 Medium

Maximum Length of Repeated Subarray

#718 Medium

Count Different Palindromic Subsequences

#730 Hard

Delete and Earn

#740 Medium

Cherry Pickup

#741 Hard

Min Cost Climbing Stairs

#746 Easy

Largest Plus Sign

#764 Medium

Sliding Puzzle

#773 Hard

Cheapest Flights Within K Stops

#787 Medium

Rotated Digits

#788 Medium

Domino and Tromino Tiling

#790 Medium

Number of Matching Subsequences

#792 Medium

Champagne Tower

#799 Medium

Minimum Swaps To Make Sequences Increasing

#801 Hard

Split Array With Same Average

#805 Hard

Soup Servings

#808 Medium

Largest Sum of Averages

#813 Medium

Race Car

#818 Hard

Binary Trees With Factors

#823 Medium

Count Unique Characters of All Substrings of a Given String

#828 Hard

Sum of Distances in Tree

#834 Hard

New 21 Game

#837 Medium

Push Dominoes

#838 Medium

Longest Mountain in Array

#845 Medium

Shortest Path Visiting All Nodes

#847 Hard

Minimum Number of Refueling Stops

#871 Hard

Length of Longest Fibonacci Subsequence

#873 Medium

Stone Game

#877 Medium

Profitable Schemes

#879 Hard

Super Egg Drop

#887 Hard

All Possible Full Binary Trees

#894 Medium

Bitwise ORs of Subarrays

#898 Medium

Numbers At Most N Given Digit Set

#902 Hard

Valid Permutations for DI Sequence

#903 Hard

Sum of Subarray Minimums

#907 Medium

Cat and Mouse

#913 Hard

Maximum Sum Circular Subarray

#918 Medium

Number of Music Playlists

#920 Hard

Flip String to Monotone Increasing

#926 Medium

Minimum Falling Path Sum

#931 Medium

Knight Dialer

#935 Medium

Distinct Subsequences II

#940 Hard

Find the Shortest Superstring

#943 Hard

Tallest Billboard

#956 Hard

Delete Columns to Make Sorted III

#960 Hard

Least Operators to Express Number

#964 Hard

Binary Tree Cameras

#968 Hard

Odd Even Jump

#975 Hard

Longest Turbulent Subarray

#978 Medium

Minimum Cost For Tickets

#983 Medium

Number of Squareful Arrays

#996 Hard

Minimum Cost to Merge Stones

#1000 Hard

Numbers With Repeated Digits

#1012 Hard

Best Sightseeing Pair

#1014 Medium

Video Stitching

#1024 Medium

Divisor Game

#1025 Easy

Longest Arithmetic Subsequence

#1027 Medium

Maximum Sum of Two Non-Overlapping Subarrays

#1031 Medium

Uncrossed Lines

#1035 Medium

Minimum Score Triangulation of Polygon

#1039 Medium

Partition Array for Maximum Sum

#1043 Medium

Longest String Chain

#1048 Medium

Last Stone Weight II

#1049 Medium

Shortest Common Supersequence

#1092 Hard

Filling Bookcase Shelves

#1105 Medium

Smallest Sufficient Team

#1125 Hard

Minimum Cost Tree From Leaf Values

#1130 Medium

N-th Tribonacci Number

#1137 Easy

Largest 1-Bordered Square

#1139 Medium

Stone Game II

#1140 Medium

Longest Common Subsequence

#1143 Medium

Longest Chunked Palindrome Decomposition

#1147 Hard

Number of Dice Rolls With Target Sum

#1155 Medium

As Far from Land as Possible

#1162 Medium

Maximum Subarray Sum with One Deletion

#1186 Medium

Make Array Strictly Increasing

#1187 Hard

K-Concatenation Maximum Sum

#1191 Medium

Longest Arithmetic Subsequence of Given Difference

#1218 Medium

Count Vowels Permutation

#1220 Hard

Dice Roll Simulation

#1223 Hard

Airplane Seat Assignment Probability

#1227 Medium

Maximum Profit in Job Scheduling

#1235 Hard

Maximum Score Words Formed by Letters

#1255 Hard

Greatest Sum Divisible by Three

#1262 Medium

Number of Ways to Stay in the Same Place After Some Steps

#1269 Hard

Count Square Submatrices with All Ones

#1277 Medium

Palindrome Partitioning III

#1278 Hard

Minimum Falling Path Sum II

#1289 Hard

Number of Paths with Max Score

#1301 Hard

Minimum Insertion Steps to Make a String Palindrome

#1312 Hard

Minimum Distance to Type a Word Using Two Fingers

#1320 Hard

Minimum Number of Taps to Open to Water a Garden

#1326 Hard

Find the City With the Smallest Number of Neighbors at a Threshold Distance

#1334 Medium

Minimum Difficulty of a Job Schedule

#1335 Hard

Jump Game V

#1340 Hard

Maximum Students Taking Exam

#1349 Hard

Count All Valid Pickup and Delivery Options

#1359 Hard

Largest Multiple of Three

#1363 Hard

Longest ZigZag Path in a Binary Tree

#1372 Medium

Maximum Sum BST in Binary Tree

#1373 Hard

Sort Integers by The Power Value

#1387 Medium

Pizza With 3n Slices

#1388 Hard

Count Number of Teams

#1395 Medium

Find All Good Strings

#1397 Hard

Reducing Dishes

#1402 Hard

Stone Game III

#1406 Hard

Number of Ways to Paint N × 3 Grid

#1411 Hard

Restore The Array

#1416 Hard

Build Array Where You Can Find The Maximum Exactly K Comparisons

#1420 Hard

Constrained Subsequence Sum

#1425 Hard

Number of Ways to Wear Different Hats to Each Other

#1434 Hard

Number of Ways of Cutting a Pizza

#1444 Hard

Form Largest Integer With Digits That Add up to Target

#1449 Hard

Max Dot Product of Two Subsequences

#1458 Hard

Cherry Pickup II

#1463 Hard

Probability of a Two Boxes Having The Same Number of Distinct Balls

#1467 Hard

Paint House III

#1473 Hard

Find Two Non-overlapping Sub-arrays Each With Target Sum

#1477 Medium

Allocate Mailboxes

#1478 Hard

Kth Ancestor of a Tree Node

#1483 Hard

Longest Subarray of 1's After Deleting One Element

#1493 Medium

Parallel Courses II

#1494 Hard

Count Submatrices With All Ones

#1504 Medium

Stone Game IV

#1510 Hard

Number of Sub-arrays With Odd Sum

#1524 Medium

Number of Good Ways to Split a String

#1525 Medium

Minimum Number of Increments on Subarrays to Form a Target Array

#1526 Hard

String Compression II

#1531 Hard

Get the Maximum Score

#1537 Hard

Minimum Cost to Cut a Stick

#1547 Hard

Minimum Number of Days to Eat N Oranges

#1553 Hard

Stone Game V

#1563 Hard

Maximum Length of Subarray With Positive Product

#1567 Medium

Number of Ways to Reorder Array to Get Same BST

#1569 Hard

Count All Possible Routes

#1575 Hard

Minimum Time to Make Rope Colorful

#1578 Medium

Maximum Non Negative Product in a Matrix

#1594 Medium

Minimum Cost to Connect Two Groups of Points

#1595 Hard

Minimum One Bit Operations to Make Integers Zero

#1611 Hard

Count Subtrees With Max Distance Between Cities

#1617 Hard

Number of Sets of K Non-Overlapping Line Segments

#1621 Medium

Best Team With No Conflicts

#1626 Medium

Count Substrings That Differ by One Character

#1638 Medium

Number of Ways to Form a Target String Given a Dictionary

#1639 Hard

Count Sorted Vowel Strings

#1641 Medium

Kth Smallest Instructions

#1643 Hard

Maximum Repeating Substring

#1668 Easy

Maximum Absolute Sum of Any Subarray

#1749 Medium

Number of Ways to Arrive at Destination

#1976 Medium

Solving Questions With Brainpower

#2140 Medium

Count the Number of Ideal Arrays

#2338 Hard

Count the Number of Powerful Integers

#2999 Hard