GS OA – Two Flowers
Problem Link - Link The question asks us to find the length of the maximum connected component under the constraint that we can merge at max two different numbers. We…
Problem Link - Link The question asks us to find the length of the maximum connected component under the constraint that we can merge at max two different numbers. We…
Question We are given a perfect N-ary tree where N denotes the number of children a node has. The tree has infinite nodes. You are given two nodes x,y. You…
From now onwards, Tubby = D and Tom = C. So D has to catch C and the first turn is of D. So, the very first thing is to…
This is a well-known method to solve linear equations with 2 or more variables. The specialty of this method is that it provides integer solutions to the linear equation of…
Hi, this post involves a fairly common technique involved in problems on Trees. The technique is called DSU on Trees - "Small to Large" The idea is used in problems…
Introduction to Binary Lifting This is a technique that is widely used to solve problems based on trees and graphs. As the name suggests, we take leaps from current node…
Problem Link - https://www.spoj.com/problems/SUMPRO/ Problem Statement : Given a number N, find the sum of all products x*y such that N/x = y (Integer Division).Since, the sum can be very large, please output this modulo 1000000007.…
Counting Zeroes Problem Statement: here As you have seen in the title of the post, we are going to perform range updates in this question. Till now, in our series, we…
JosephLand Problem Statement: here 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…
A Brief Introduction Problem Statement - Find the maximum sum sub-array of the given array Let us assume the maximum sum sub-array lies between index L to R. We can…