# Category Archives: Algorithms

## Count ways to express a number as sum of powers

Given two integers x and n, we need to find number of ways to express x as sum of n-th powers of unique natural numbers.… Read More »

## To check a number is palindrome or not without using any extra space

Given a number ‘n’ and our goal is to find out it is palindrome or not without using any extra space. We can’t make a… Read More »

## Largest rectangular sub-matrix whose sum is 0

Given a 2D matrix, find the largest rectangular sub-matrix whose sum is 0. for example consider the following N x M input matrix Examples: Input… Read More »

## Coin game winner where every player has three choices

A and B are playing a game. At the beginning there are n coins. Given two more numbers x and y. In each move a… Read More »

## Rearrange an array in order – smallest, largest, 2nd smallest, 2nd largest, ..

Given an array of integers, task is to print the array in the order – smallest number, Largest number, 2nd smallest number, 2nd largest number,… Read More »

## Find smallest permutation of given number

Given a long integer, return the smallest(magnitude) integer permutation of that number. Examples: Input : 5468001 Output : 1004568 Input : 5341 Output : 1345… Read More »

## GE digital Interview Experience | Set 6

First Round 110 students were selected, cutoff was 64.5 to give the first round. It was an online test having 5 sections. Platform was AMCAT.… Read More »

## Check if a given string is sum-string

Given a string of digits, determine whether it is a ‘sum-string’. A string S is called a sum-string if a rightmost substring can be written… Read More »

## Find a triplet such that sum of two equals to third element

Given an array of integers you have to find three numbers such that sum of two elements equals the third element. Examples: Input : {5,… Read More »

## Shortest possible combination of two strings

Compute the shortest string for a combination of two given strings such that the new string consist of both the strings as its subsequences. Examples:… Read More »

## Analysis of Different Methods to find Prime Number in Python

If you participate in the competitive programming, you might be familiar with the fact that questions related to Prime numbers are one of the choices… Read More »

## Repeatedly search an element by doubling it after every successful search

Given an array “a[]” and integer “b”. Find whether b is present in a[] or not. If present, then double the value of b and… Read More »

## Distributing M items in a circle of size N starting from K-th position

M items are to be delivered in a circle of size M. Find the position where the M-th item will be delivered if we start… Read More »

## Make all combinations of size k

Given two numbers n and k and you have to find all possible combination of k numbers from 1…n. Examples: Input : n = 4… Read More »

## Check whether right angled triangle is valid or not for large sides

Given three integers a, b and c as triplets. Check if it is possible to make right angled triangle or not. Print Yes if possible,… Read More »