D. Constant Palindrome Sum

Problem Statement - here This question requires prior knowledge of computing prefix sum technique. This allows us to solve the question in O(N)So, for every pair (a[i],a[n-i-1]) -> we will…

Continue Reading D. Constant Palindrome Sum

Trapping Rain Water

Problem Statement : https://leetcode.com/problems/trapping-rain-water/ Water will be bounded if there exist two piles at index i and j where |j-i| > 1. So, we will use a stack to answer this…

Continue Reading Trapping Rain Water

JTREE

Problem Statement -https://www.codechef.com/problems/JTREEhttps://www.codechef.com/problems/JTREE The problem, in short, says: You have a tree with edges directed towards the root and nodes having some tickets. Each ticket allows you to move k…

Continue Reading JTREE