Skip to main content

105 docs tagged with "Dynamic Programming"

View all tags

01 Matrix

This is a solution to the 542. 01 Matrix problem on LeetCode.

Array Nesting

This is a solution to the Array Nesting problem on LeetCode.

Best Time to Buy and Sell Stock

This article provides a solution to the Best Time to Buy and Sell Stock problem, which finds the maximum profit that can be obtained by buying and selling a stock at most once.

Binary Trees With Factors

This document provides a solution to the Binary Trees With Factors problem, where we need to count the number of binary trees that can be formed with a given array of integers such that each node's value is the product of its children's values.

Binary Trees With Factors

This document provides a solution to the Binary Trees With Factors problem, where we need to count the number of binary trees that can be formed with a given array of integers such that each node's value is the product of its children's values.

Burst-Ballons

This is a solution to the Burst Ballons problem on LeetCode.

Cat and Mouse

This is a solution to the Cat and Mouse problem on LeetCode.

Cherry Pickup

This is a solution to the Cherry Pickup problem on LeetCode.

Climbing Stairs

This document explores different approaches to solving the climbing stairs problem, including recursion, memoization, tabulation, and space optimization.

Coin Change

This is a solution to the Coin Change problem on LeetCode.

Coin Change 2

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up that amount.

Domino and Tromino Tiling

Solve the problem of finding the number of ways to tile a 2 x n board using 2 x 1 dominos and tromino shapes.

Dungeon Game

Given a 2D array representing a dungeon, return the minimum initial health required for a knight to reach the bottom-right corner.

Edit Distance(LeetCode)

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

Fibonacci Sum (Geeks for Geeks)

This tutorial contains a complete walk-through of the Fibonacci Sum problem from the Geeks for Geeks website. It features the implementation of the solution code in three programming languages: Python, C++, and Java.

Grid Game

This is a solution to the Grid Game problem where two robots play optimally on a 2D grid.

House Robber II

This document provides a solution to the House Robber II problem, where houses are arranged in a circle.

IPO

Problem Description

Jump Game

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.

Jump Game II(LeetCode)

You are given a 0-indexed array of integers nums of length `n`. Return the minimum number of jumps to reach `nums[n - 1]`.

Magic Number

This tutorial covers the solution to the Magic Number problem from the GeeksforGeeks.

Maximal Square

This document provides a solution where we find the largest square containing only 1's and return its area.

Maximum Total Reward Using Operations

This document provides solutions for finding the maximum total reward using dynamic programming and bit manipulation, implemented in C++, Java, and Python.

Min falling path sum in a Triangle

Given a triangular type matrix we need to return the minimum sum for reaching the bottom from the top . in each step we can either move down or diagonally right

Min falling path sum in a Triangle

Given a triangular type matrix we need to return the minimum sum for reaching the bottom from the top . in each step we can either move down or diagonally right

Minimize Manhattan Distances

This document provides solutions for Minimize Manhattan Distances using dynamic implemented in C++, Java, and Python.

Minimum Cost to Cut a Stick

Solve the problem of finding the minimum cost to cut a stick into smaller pieces at specified positions, using dynamic programming.

Minimum Path Sum(LeetCode)

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

Next Happy Number (Geeks for Geeks)

This tutorial contains a complete walk-through of the Next Happy Number problem from the Geeks for Geeks website. It features the implementation of the solution code in three programming languages: Python, C++, and Java.

Nth Fibonacci Number

This tutorial covers the solution to the Nth Fibonacci Number problem from the GeeksforGeeks.

Nth Fibonacci Number Problem (gfg)

This tutorial covers the solution to the Nth Fibonacci Number problem from the GeeksforGeeks website, featuring implementations in Python and C++.

Number of Digit One

This document provides a solution where we count the total number of digit $1$ appearing in all non-negative integers less than or equal to n.

Paths to Reach Origin

This document explores finding the number of paths to reach the origin (0, 0) on a grid.

Reducing Dishes

This document provides a solution to the Reducing Dishes problem, where we need to maximize the sum of the satisfaction of dishes.

Regular Expression Matching (LeetCode)

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where '.' matches any single character and '*' matches zero or more of the preceding element.

Split Array With Same Average

This document provides a solution where we split an array into two non-empty subsets such that both subsets have the same average.

Target Sum

This is a solution to the Target Sum problem on LeetCode.

Total Appeal of a String

This document provides a solution to the Total Appeal of a String problem, where we need to calculate the total appeal of all substrings of a given string.

Trapping Rain Water(LeetCode)

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

Ugly Number II

This document provides a solution to the Ugly Number II problem, where we need to find the nth ugly number.

Unique Paths II(LeetCode)

There is a robot initially located at the top-left corner. The robot tries to move to the bottom-right corner. Return the number of possible unique paths that the robot can take to reach the bottom-right corner.

Water-Bottles-II

This document provides solutions for Water-bottles-II solution of leetcode questions

Ways To Tile A Floor

This document covers methods to calculate the number of ways to tile a floor of given dimensions using tiles of given sizes in various programming languages.

Word Break II

This document provides solutions for the Word Break II problem.

Word Break(LeetCode)

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.