# Category Archives: Competitive Programming

## Find two numbers from their sum and XORNovember 19, 2017

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 »

## Number of days until all chocolates become unhealthyNovember 16, 2017

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 »

## Largest number with one swap allowedNovember 14, 2017

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 »

## Print all subsequences of a string | Iterative MethodNovember 10, 2017

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 »

## BFS using STL for competitive codingOctober 20, 2017

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 »

## Bits manipulation (Important tactics)October 16, 2017

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 »

## Why is python best suited for Competitive Coding?October 5, 2017

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 Tricks for Competitive Coding

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 »

## Represent a number as sum of minimum possible psuedobinary numbersSeptember 23, 2017

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 »

## Array range queries over range queriesSeptember 22, 2017

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 ChallengeJuly 31, 2017

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 »

## Writing code faster in C++ STLJuly 20, 2017

You are wondering some time coder write his code in 2 min or less how? No kidding! Although this tip may not be very useful… Read More »

## Common mistakes to be avoided in Competitive Programming in C++ | BeginnersJune 13, 2017

Not using of 1LL or 1ll when needed Output: -727379968 You might get some other negative value as output. So what is the problem here?… Read More »

## Bit Tricks for Competitive ProgrammingJune 7, 2017

In competitive programming or in general some problems seems difficult but can be solved very easily with little bit magic. We have discussed some tricks… Read More »

## Java tricks for competitive programming (for Java 8)June 6, 2017

Although practice is the only way that ensures increased performance in programming contests but having some tricks up your sleeve ensures an upper edge and… Read More »