Given an array A[] and size of array is N. The task is to replace element of array A[] are in given range L to R both are included. Element replace by Read more →
Searching
27 postsThere is given a sum and you have to find whether this sum is resultant of summation of first n natural numbers or not. If it is summation of first n natural Read more →
You have a total of n coins and you want to arrange the coins in staircase shape, where every i-th row must have exactly i coins. You want to find the total Read more →
Given an array in increasing order and a target, return indices of two numbers such that they add up to the target. You have to return an array of indices where the Read more →
Given an array arr[] and the two elements x and y, the task is to find which element(x or y) has highest occurrence in the array. If the occurrences are the same, Read more →
Given an integer array arr[] and K, the task is to count the number of elements ‘A[i]’, such that A[i] * K is also present in the array. Note: If there are Read more →
Given an array arr[] of n elements, write a function to search a given element x in arr[]. Examples: Input : arr[] = {10, 20, 80, 30, 60, 50, 110, 100, 130, Read more →
Given a string str. The task is to check whether this string can be splitted into two strings X and Y such that Y is a substring of X X + Y Read more →
Given an array of size N, print the index of the distinct element from the array, provided the array has only one distinct element and rest other elements are same. Examples: Input: Read more →
Given an array consisting of integers in range 1 to n consisting of only one duplicate element. Find out the duplicate element in O(logN) time. Examples: Input : 6 1 1 2 Read more →