Dynamic Programming

‘Recent Articles’ on Dynamic Programming


Basic Concepts:

Advanced Concepts :

Basic Problems :

  1. Fibonacci numbers
  2. Binomial Coefficient
  3. Longest Common Subsequence
  4. Longest Repeated Subsequence
  5. Largest Sum Contiguous Subarray
  6. Ugly numbers
  7. Maximum size square sub-matrix with all 1s
  8. Longest Increasing Subsequence
  9. Min Cost Path
  10. Coin change problem
  11. Minimum number of edits ( operations ) require to convert string 1 to string 2
  12. Cutting a Rod
  13. Subset Sum Problem
  14. Minimum number of jumps to reach end
  15. Assembly line scheduling
  16. Maximum Sum Increasing Subsequence
  17. Maximum Length Chain of Pairs
  18. Longest Common Substring
  19. Count all possible paths from top left to bottom right of a mXn matrix
  20. nth Catalan Number
  21. Count number of ways to reach a given score in a game
  22. Tiling Problem
  23. Count even length binary sequences with same sum of first and second half bits
  24. Find number of solutions of a linear equation of n variables
  25. Bell Numbers (Number of ways to Partition a Set)
  26. Compute nCr % p
  27. Permutation Coefficient
  28. Count number of ways to fill a “n x 4” grid using “1 x 4” tiles
  29. A Space Optimized Solution of LCS
  30. Find maximum length Snake sequence
  31. Minimum cost to fill given weight in a bag
  32. Choice of area
  33. Maximum weight path ending at any element of last row in a matrix
  34. Recursively break a number in 3 parts to get maximum sum
  35. Path with maximum average value
  36. Maximum sum of pairs with specific difference
  37. Maximum subsequence sum such that no three are consecutive
  38. Longest subsequence such that difference between adjacents is one
  39. Maximum path sum for each position with jumps under divisibility condition
  40. Maximum sum Bi-tonic Sub-sequence
  41. LCS (Longest Common Subsequence) of three strings
  42. Maximum path sum in a triangle
  43. Friends Pairing Problem
  44. Size of array after repeated deletion of LIS
  45. Minimum steps to minimize n as per given condition
  46. Maximum path sum that starting with any cell of 0-th row and ending with any cell of (N-1)-th row
  47. Gold Mine Problem
  48. Find number of endless points
  49. Perfect Sum Problem (Print all subsets with given sum)
  50. Maximum sum of a path in a Right Number Triangle
  51. Subset with sum divisible by m

Intermediate Problems :

  1. 0-1 Knapsack Problem
  2. Length of the longest substring without repeating characters
  3. Count number of ways to reach destination in a Maze
  4. Super Ugly Number (Number whose prime factors are in given set)
  5. Count number of ways to partition a set into k subsets
  6. Longest Palindromic Subsequence
  7. Egg Dropping Puzzle
  8. Weighted job scheduling
  9. Longest Bitonic Subsequence
  10. Floyd Warshall Algorithm
  11. Partition Problem
  12. Variations of LIS
  13. Box-Stacking Problem
  14. Bellman–Ford Algorithm
  15. Optimal Binary Search Tree
  16. Largest Independent Set Problem
  17. Minimum insertions to form a palindrome
  18. Minimum number of deletions to make a string palindrome
  19. Maximum Product Cutting
  20. Clustering/Partitioning an array such that sum of square differences is minimum
  21. Maximum decimal value path in a binary matrix
  22. Count Derangements (Permutation such that no element appears in its original position)
  23. Dice Throw Problem
  24. Optimal Strategy for a game
  25. Word Break Problem
  26. Remove minimum elements from either side such that 2*min becomes more than max
  27. Count number of binary strings without consecutive 1’s
  28. Count Possible Decodings of a given Digit Sequence
  29. Count all possible walks from a source to a destination with exactly k edges
  30. Shortest path with exactly k edges in a directed and weighted graph
  31. Longest Even Length Substring such that Sum of First and Second Half is same
  32. Vertex Cover Problem
  33. Find the minimum cost to reach destination using a train
  34. Maximum profit by buying and selling a share at most twice
  35. Count possible ways to construct buildings
  36. Compute sum of digits in all numbers from 1 to n
  37. Shortest Common Supersequence
  38. Minimum number of coins that make a given value
  39. Minimum number of squares whose sum equals to given number n
  40. length of the longest consecutive path from a given starting character
  41. Total number of non-decreasing numbers with n digits
  42. Minimum Initial Points to Reach Destination
  43. Count of n digit numbers whose sum of digits equals to given sum
  44. Count total number of N digit numbers such that the difference between sum of even and odd digits is 1
  45. Count ways to assign unique cap to every person
  46. Longest Repeating Subsequence
  47. Find the longest path in a matrix with given constraints
  48. Number of paths with exactly k coins
  49. Collect maximum coins before hitting a dead end
  50. Count number of paths with at-most k turns
  51. Partition a set into two subsets such that the difference of subset sums is minimum
  52. Longest Zig-Zag Subsequence
  53. Largest sum Zigzag sequence in a matrix
  54. Count number of subsets having a particular XOR value
  55. Weighted Job Scheduling in O(n Log n) time
  56. Ways to arrange Balls such that adjacent balls are of different types
  57. Minimum time to finish tasks without skipping two consecutive
  58. Find if string is K-Palindrome or not | Set 1
  59. Find if string is K-Palindrome or not | Set 2
  60. Wildcard Pattern Matching
  61. Longest Common Increasing Subsequence (LCS + LIS)
  62. Printing Longest Common Subsequence | Set 2 (Printing All)
  63. High-effort vs. Low-effort Tasks Problem
  64. Find minimum adjustment cost of an array
  65. Find Jobs involved in Weighted Job Scheduling
  66. Minimum Cost To Make Two Strings Identical
  67. Find number of times a string occurs as a subsequence in given string
  68. Count digit groupings of a number with given constraints
  69. Non-crossing lines to connect points in a circle
  70. Count Distinct Subsequences
  71. Find minimum sum such that one of every three consecutive elements is taken
  72. Count distinct occurrences as a subsequence
  73. Number of permutation with K inversions
  74. Print all longest common sub-sequences in lexicographical order
  75. Find all distinct subset (or subsequence) sums of an array
  76. Count All Palindromic Subsequence in a given String
  77. Maximum sum alternating subsequence
  78. Sum of average of all subsets
  79. Minimum and Maximum values of an expression with * and +
  80. Minimum sum subsequence such that at least one of every four consecutive elements is picked
  81. Ways to write n as sum of two or more positive integers
  82. Unbounded Knapsack (Repetition of items allowed)
  83. Finding the maximum square sub-matrix with all equal elements
  84. Find Maximum dot product of two arrays with insertion of 0’s
  85. Maximum points collected by two persons allowed to meet once
  86. Minimum Sum Path In 3-D Array
  87. Count binary strings with k times appearing adjacent two set bits
  88. Highway Billboard Problem
  89. Probability of getting at least K heads in N tosses of Coins
  90. Count of strings that can be formed using a, b and c under given constraints
  91. Modify array to maximize sum of adjacent differences
  92. Temple Offerings
  93. Longest alternating subsequence
  94. Minimum steps to delete a string after repeated deletion of palindrome substrings
  95. Minimum number of deletions to make a sorted sequence
  96. Count number of ways to jump to reach end
  97. Shortest Uncommon Subsequence
  98. Minimum insertions to sort an array
  99. Dynamic Programming | Building Bridges

Hard Problems :

  1. Palindrome Partitioning
  2. Word Wrap Problem
  3. Maximum sum rectangle in a 2D matrix
  4. Matrix Chain Multiplication
  5. Longest Geometric Progression
  6. Find all combinations of k-bit numbers with n bits set where 1 <= n <= k in sorted order
  7. Find if a string is interleaved of two other strings
  8. Longest Arithmetic Progression
  9. Boolean Parenthesization Problem
  10. Mobile Numeric Keypad Problem
  11. Minimum Cost Polygon Triangulation
  12. How to print maximum number of A’s using given four keys
  13. Smallest length string with repeated replacement of two distinct adjacent
  14. Collect maximum points in a grid using two traversals
  15. Maximum weight transformation of a given string
  16. Find minimum possible size of array with given rules for removing elements
  17. Maximum profit by buying and selling a share at most k times
  18. Number of subsequences in a string divisible by n
  19. Maximize arr[j] – arr[i] + arr[l] – arr[k], such that i < j < k < l
  20. A Space Optimized DP solution for 0-1 Knapsack Problem
  21. Longest repeating and non-overlapping substring
  22. All ways to add parenthesis for evaluation
  23. Number of palindromic paths in a matrix
  24. Minimum cost to sort strings using reversal operations of different costs
  25. Minimum number of elements which are not part of Increasing or decreasing subsequence in array
  26. Printing brackets in Matrix Chain Multiplication Problem
  27. Check if all people can vote on two machines
  28. Probability of Knight to remain in the chessboard
  29. Count of AP (Arithmetic Progression) Subsequences in an array
  30. Number of subsequences of the form a^i b^j c^k
  31. Count ways to increase LCS length of two strings by one
  32. Count of arrays in which all adjacent elements are such that one of them divide the another
  33. Check whether row or column swaps produce maximum size binary sub-matrix with all 1s

More >>

Quick Links :

  1. Top 20 Dynamic Programming Interview Questions
  2. ‘Practice Problems’ on Dynamic Programming
  3. ‘Quiz’ on Dynamic Programming
  4. Ask a Question on ‘Dynamic Programming’

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

Company Wise Coding Practice    Topic Wise Coding Practice