Given a square matrix of order n*n, find the maximum and minimum from the matrix given. Examples: Input : arr[][] = {5, 4, 9, 2,… Read More
Given an array of integers (both odd and even), sort them in such a way that the first part of the array contains odd numbers… Read More
Given a number N, find sum of all GCDs that can be formed by selecting all the pairs from 1 to N. Examples: Input :… Read More
We can calculate the prime factorization of a number “n” in O(sqrt(n)) as discussed here. But O(sqrt n) method times out when we need to… Read More
I applied off campus for Amazon Bangalore SDE-1. It started with two face to face rounds. Face-2-Face (Round 1) : A binary tree is given… Read More
Given an array of both positive and negative integers ‘arr[]’ which are sorted. The task is to sort the square of the numbers of the… Read More
Given an array of n elements. The task is to check whether a permutation of given array exists, such that each element indicate number of… Read More
Given a directed and connected graph with n nodes. If there is an edge from u to v then u depends on v. Our task… Read More
A non-empty binary array A consisting of size N is given where, 0 represents a car traveling east, 1 represents a car traveling west. The… Read More
A Seed of a number n is a number x such that multiplication of x with its digits is equal to n. The task is… Read More
STL is one of the pillars of C++. It makes life a lot easier, especially when your focus is on problem-solving and you don’t want… Read More
Given a doubly-linked list of characters, write a function that returns true if the given doubly linked list is a palindrome, else false. Recommended: Please… Read More
A Cullen Number is a number of the form is 2n * n + 1 where n is an integer. The first few Cullen numbers… Read More
Started with online test at Hackerearth. It had 2 questions. Find subarray with max sum. Array have both -ve and +ve integers. Consider a… Read More