We have to find a Matrix of order 3 formed by given 9-elements whose determinant is maximum. Examples: Input: arr[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9} Max Read more →
Algorithms
6 postsProblem: Given an integer ‘n’, find sum of all n digits which come in power of 2 of given number n. Examples: Input: p = 9 Output: 8 Explanation : 2^9 = Read more →
The first few terms(Fn) of Fibonacci Numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, … For given N find the sum (Sn) of 0 Read more →
Print all the perfect squares in a range i.e. a and b are the lower and upper bounds respectively. So print all the perfect squares between them and both are inclusive. Examples: Read more →
Given a n*m chess board. We can choose any rectangle formed by board squares and perform an inversion. Every white cell in the inverted rectangle becomes black and every black one becomes Read more →
Given first N natural numbers. Our task is to check whether is it possible to split the numbers in two sets such that absolute difference of the sum of numbers in the Read more →
Given an arithmetic progression and having any number of duplicates, we have to find the index of first occurrence of duplicate element in the series. After getting the index we will remove Read more →
Given an array of unique integers, print the array in such a way that the first element is first maximum and second element is first minimum and so on. We have to Read more →
LRU cache implementation: Here we have two methods get and set which are defined as follows: get(x) : If the key x exists in the cache, returns its value and update reference Read more →
Given N and M, distribute first N natural numbers in two sets such that the absolute sum of the numbers in the two sets is equal to M. If possible, print the Read more →