Determine whether two strings are anagram or not
Given two strings, determine if they are anagrams or not. Two strings X and Y are anagrams if by rearranging the letters of X, we can get Y using all the original letters of X exactly once.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven two strings, determine if they are anagrams or not. Two strings X and Y are anagrams if by rearranging the letters of X, we can get Y using all the original letters of X exactly once.
Given a string, check if a repeated subsequence is present in it or not. The repeated subsequence should have a length of 2 or more.
An island is in the form of a square matrix, and a person is standing inside the matrix. The person can move one step in any direction (right, left, top, down) in the matrix. Calculate the probability that the person is alive after walking n steps on the island, provided that he dies if he steps outside the matrix.
Given two arrays, reorder elements of the first array by the order of elements defined by the second array. The elements that are not present in the second array but present in the first array should be appended at the end sorted.
Given an array, sort its element by their frequency and index. i.e., if two elements have different frequencies, then the one which has more frequency should come first; otherwise, the one which has less index should come first.
Given an M × N matrix, find the common elements present in all rows of the matrix. The solution should traverse the matrix once and print the common elements in O(M × N) time.
Graph coloring (also called vertex coloring) is a way of coloring a graph’s vertices such that no two adjacent vertices share the same color. This post will discuss a greedy algorithm for graph coloring and minimize the total number of colors used.
This post will discuss how to determine whether two integers are equal without using comparison operators (==, !=, <, >, <=, >=) and arithmetic operators (+, -, *, /, %).
Given a large number, n, find all positive numbers less than n that can be represented as the sum of two cubes for at least two different pairs.