Check if a number is a power of 8 or not
Given a number, check if it is a power of 8 or not.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a number, check if it is a power of 8 or not.
Given a binary array, find the index of 0 to be replaced with 1 to get a maximum length sequence of continuous ones using the sliding window technique.
Given a square matrix of integers, find the maximum value of M[c][d] – M[a][b] over every choice of indexes such that c > a and d > b in a single traversal of the matrix.
Given an array with many duplicated elements, write an algorithm to efficiently sort it in linear time, where the order of equal elements doesn’t matter.
Quicksort exhibits poor performance for inputs that contain many repeated elements. The problem is visible when all the input elements are equal. In this post, we will implement Quicksort efficiently for inputs containing many repeated elements.
Write an algorithm to compute a binary tree’s height with leaf nodes forming a circular doubly linked list where the leaf node’s left and right pointers will act as a previous and next pointer of the circular doubly linked list, respectively.
Given an array of sorted integers that may contain several duplicate elements, count the total number of distinct absolute values in it.
Given an integer, reverse its bits using binary operators.
Given a mobile keypad having digits from 0 to 9 associated with each key, count total possible combinations of digits having length n. We can start with any digit and press only four adjacent keys of any digit. The keypad also contains * and # keys, which we are not allowed to press.
Given a string, break it into all possible combinations of non-overlapping substrings enclosed within curly brackets.
Given a positive integer, find the minimum number possible by doing at-most k swap operations upon its digits.
Given an array having elements between 0 and 31, find elements that occur an odd number of times without using the extra space.