## First occurrence of a digit in a given fraction

Given three integers a, b and c, find the first occurrence of c in a/b after the decimal point. If it does not exists, print… Read More »

## Find the minimum time after which one can exchange notes

Given n number of cashiers exchanging the money. At the moment, cashier had number of people in front of him. The person in the line… Read More »

## AKS Primality Test

There are several primality test available to check whether the number is prime or not like Fermat’s Theorem, Miller-Rabin Primality test and alot more. But… Read More »

## Check if the last element of array is even or odd after performing a operation p times

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 »

## The painter’s partition problem | Set 2

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 »

## Variation in Nim Game

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 »

## Passing the Assignment

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 »

## Find two numbers from their sum and XOR

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 unhealthy

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 allowed

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 Method

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 coding

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)

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?

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 »