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…

Continue Reading GS OA – Two Flowers

Largest Tree Uber OA

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…

Continue Reading Largest Tree Uber OA

Exploring Linear Diophantine Equation

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…

Continue Reading Exploring Linear Diophantine Equation

Binary Lifting #1 CF-702E

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…

Continue Reading Binary Lifting #1 CF-702E

SUMPRO – SUM OF PRODUCT

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

Continue Reading SUMPRO – SUM OF PRODUCT

#5 Range Updates and Range Queries

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…

Continue Reading #5 Range Updates and Range Queries

KADANE’S ALGORITHM

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…

Continue Reading KADANE’S ALGORITHM