Given an island in the form of square matrix and a point inside the matrix where a person is standing. The person is allowed to move one step in any direction (right, left, top, down) on the matrix. If he steps outside the matrix, he dies. Calculate the probability that he is alive after he …
Given two arrays, reorder elements of first array by order of elements defined by the second array. Elements which are not present in the second array but present in first array should be appended in the end sorted. Second array can contain some extra elements which are not part of first array.
Given an array, sort its element by their frequency and index. i.e. – If two elements have the different frequencies, then the one which has more frequency should come first. – If two elements have the same frequencies, then the one which has less index should come first.
In this post, we will see how to find common elements present in all rows of a given MxN matrix. The solution should traversal the matrix once and print all commons elements in O(M*N) time.
Given a large number N, find all positive numbers less than N that can be represented as sum of two cubes for at-least two different pairs.
Find duplicate rows present in a given binary matrix by traversing the matrix only once.
In this post, we will cover memory efficient Trie implementation in C++ using map data structure.
In this post, we will discuss various methods to iterate Map using keySet() in Java.
In this post, we will discuss various methods to iterate Map in Java using entrySet() method.