Tag: Dynamic Programming
Edit Distance program in Javascript
We have 2 strings and we can perform below operations on st1 to make it same as str2. Insert Remove Replace Input: str1 = “cat”, str2 = “cut”Output: 1We can […]
Minimum number of jumps to reach end of array in Javascript
Write a function to return the minimum number of jumps to reach the end of the array (starting from the first element). If an element is 0, they cannot move […]
Longest Common Subsequence Program in Javascript
Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. […]
Longest Increasing Subsequence in Javascript
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing […]
Minimum number of coins program in Javascript
Input: coins[] = {25, 10, 5}, V = 30 Output: Minimum 2 coins required We can use one coin of 25 cents and one of 5 cents This program can […]