Skip to content

Category Archives: Competitive Programming

Given is an array of n non-negative integers. The operation is to insert a number in the array which is strictly greater than current sum… Read More
We have to paint n boards of length {A1, A2, .. An}. There are k painters available and each takes 1 unit time to paint… Read More
Prerequisites: Sprague Gruncy theorem Grundy Numbers Nim is a famous game in which two players take turns removing items from distinct piles. During each turn,… Read More
Rachel is submitting assignment from every student. She has given them a few minutes to arrange their assignments before submission. Just then Rahul remembers that… Read More
Given the sum and xor of two numbers X and Y s.t. sum and xor , we need to find the numbers minimizing the value… Read More
Pablo has square chocolate Box of size n x n in which a variety of healthy chocolates are present denoted by ‘H’ initially but he… Read More
Given a positive integer, find the largest number that could be generated by swapping only two digits at most once. Examples: Input: 2736 Output :… Read More
Given a string s, print all possible subsequences of the given string in an iterative manner. We have already discussed Recursive method to print all… Read More
A STL based simple implementation of BFS using queue and vector in STL. The adjacency list is represented using vectors of vector. In BFS, we… Read More
Prerequisites : Bitwise operators in C, Bitwise Hacks for Competitive Programming, Bit Tricks for Competitive Programming Compute XOR from 1 to n (direct method) :… Read More
When it comes to Product Based Companies, they need good coders and one needs to clear the Competitive Coding round in order to reach the… Read More
Python is one such programming language which makes everything easier and straight forward. Anyone who has dabbled in python for Competitive Coding gets somewhat addicted… Read More
Given a number, you have to represent this number as sum of minimum number of possible psuedobinary numbers. A number is said to be psuedobinary… Read More
Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands… Read More
The Google Foo bar challenge has been known for the last 5 years or more as a secret process of hiring developers and programmers all… Read More