## 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 »

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 »

Given a number n. The problem is to find the sum of first n even numbers. Examples: Input : n = 4 Output : 20… Read More »

The positive odd numbers in ascending order as 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, …. and grouped as (1), (3, 5),… Read More »

Given a matrix of N X M, each cell consist of an integer. We have initial power of K and we are allowed to move… Read More »

Given the sequence of odd numbers 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, …. Find the sum of first n… Read More »

Before moving to the actual solution, let’s try to find out what is a degree, a radian, and their relations. Radian : The radian is… Read More »

Given a speed in km/hr, Convert it to m/hr and m/hr to km/hr. Examples: Input : 150 (km/hr) Output : 93.21 Input : 100 (m/hr)… Read More »

Given a series 2, 12, 36, 80, 150.. Find the n-th term of the series. Examples: Input : 2 Output : 12 Input : 4… Read More »

Given three integers A, B and K. We need to find no. of K-prime numbers in the range [A, B]. A number is called K-prime… Read More »

Given two string X, Y and an integer k. Now the task is to convert string X with minimum cost such that the Longest Common… Read More »

Given an array of n distinct elements, find length of the largest subset such that every pair in the subset is such that the larger… Read More »

There are two players A and B who are interested in playing a game of numbers. In each move a player pick two distinct number,… Read More »

In combinatorics, the Narayana numbers N(n, k), n = 1, 2, 3 …, 1 <= k <= n, form a triangular array of natural numbers,… Read More »

Given an array of n-elements, we have to find the largest element among them without using any conditional operator like greater than or less than.… Read More »

Given two integers N and M. Consider two matrix ANXM, BNXM. Both matrix A and matrix B contains elements from 1 to N*M. Matrix A… Read More »