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.
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.
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.
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
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.