Skip to content

Only Code

Eat Code Sleep – repeat

  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Close menu
  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Search Toggle menu

Category: Dynamic Programming

Longest Common Subsequence Solution

The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to given two sequences. LCS problem is used to determine how similar the two DNA strands are.

Dynamic Programming

Longest Increasing Subsequence Solution (LIS) – LeetCode Solution [Medium]

Given an integer array arr, return the length of the longest strictly increasing subsequence. Strictly increasing sequence is a sequence such that all elements of the sequence are sorted in increasing order.

Arrays, Dynamic Programming

Find the minimum distance to travel through a road having hills [Interview Question]

Alansh has to travel through a road having hills of different heights. Also each hill has a cave to pass through it, to avoid travelling extra distance of a hill. Alansh wants to travel through this road by taking at most K caves.

Dynamic Programming, Interview Questions

Edit Distance – LeetCode Solution [Hard]

Given two strings word1 and word2 (in lowercase alphabets), return the minimum number of operations required to convert word1 to word2.

Dynamic Programming, Interview Questions

Decode Ways – LeetCode Solution [Medium]

A message containing letters from A-Z can be encoded into numbers. To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping

Dynamic Programming

Greedy approach vs Dynamic Programming

Greedy approach and Dynamic programming both are used for solving optimisation problems. However often we need to use DP since optimal solution cannot be guaranteed by a greedy algorithm.

Dynamic Programming, Greedy approach

Knapsack problem (Finding selected items)

A little recap: Let given weights & values of n items to be put in a knapsack of capacity W ie.

Dynamic Programming

Knapsack Problem (Dynamic Programming)

An optimal solution to problem contain optimal solution to subproblems. To consider all subset of items, 2 cases for every item arises

Dynamic Programming

Posts pagination

< 1 2 3
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Computer Science
  • Data Science
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Coding Questions
  • Machine Learning
  • Mathematics
  • Networking
  • Programming Projects
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2025 Only Code | Aureolls
Exit mobile version