You are given two boxes. The first box is empty while in the second, there are 3 piles of coins. Whenever you choose a pile of X coins (x>=1) from the second Read more →
Data Structures
5 postsGiven a numeric string, the task is to split the string into the sequence of two or more positive integers and check that it satisfies the following conditions or not. 1. Each Read more →
Given a 2D Grid consisting of integer values the task is to check whether there is a cycle in the grid or not . A valid cycle in the grid should follow Read more →
Given two natural numbers N1 and N2.The task is to find the maximum possible sum after swapping of a single digit between two given natural numbers. Examples : Input : N1=123 N2=998 Read more →
You are given an integer array which is sorted in non-decreasing order. Build and return an integer array result with the same length as the integer array such that result[i] is equal Read more →
Given an array of N elements. You have to partition the array into two non-empty subarrays such that every number in the right subarray is strictly greater than every number in the Read more →
Given a disconnected graph G with N vertices and M edges and cost[] for all the vertices, the task is to add edges to G to make it connected and to add Read more →
Given two arrays with unequal sizes, you have to take one element from first array(say a) and one element from array 2(say b). If the sum of a and b is a Read more →
You are given a positive integer n, and an array a of positive integers. Find number of such pairs (i,j) such that i<j and ai & aj ≥ ai ^ aj, where Read more →
A string is called happy if it does not have any of the strings ‘aaa’, ‘bbb’ or ‘ccc’ as a substring. Given three integers a, b and c, return any string s, Read more →