C – Many Requirements

Problem Statement: here TAGBackTracking, Full Search, Recursion The problem must be solved using the concept of recursion. The constraints were so small, that we could generate all the possible permutations of…

Continue Reading C – Many Requirements

Strings #1 Application of KMP

Shortest Palindrome Question : here So this problem requires us to find the shortest length of palindrome by appending characters in front of the string. Clearly, the fewer characters we…

Continue Reading Strings #1 Application of KMP

Understanding the NlogN Approach for LIS

We already know about the quadratic time LIS approach using Dynamic Programming. Today, we gonna see and understand the shortest O(nlogn) approach for LIS. Let the sequence be A =…

Continue Reading Understanding the NlogN Approach for LIS

D – Sum of Large Numbers

Problem Statement : here The tricky part is the addition of 10^100. So, let us assume that we are using k numbers to generate our sum. Clearly, in this case, the…

Continue Reading D – Sum of Large Numbers

Longest Repeated Substring

Power of String (Question) : here We have to find the longest substring occurring in the string at least K times.The golden point is:  EVRY SUBSTRING IS A PREFIX OF…

Continue Reading Longest Repeated Substring

Longest Common Substring

The Story of String (Question) : here This is the first problem with suffix arrays. so I will give a little boring lecture on it. So, bare with me. Suffix Arrays…

Continue Reading Longest Common Substring

F – LIS on Tree

Problem Statement: here There is more than one way to solve this problem. We shall see two different implementations. The first implementation is an easy version and it uses LIS in O(nlogn)…

Continue Reading F – LIS on Tree

Dish Owner

Problem Statement: here This is the first problem in the Disjoint Set Union series, so bare a small lecture from my side. Disjoint Set Union is a technique that allows us…

Continue Reading Dish Owner

C: Nastya and Strange Generators

Problem Statement: here If you figure out the problem statement, it is asking just one thing for you to implement. So, few observations are: If my 1 is not on the extreme…

Continue Reading C: Nastya and Strange Generators