Implement Diff Utility
Implement your diff utility, i.e., given two similar strings, efficiently list out all differences between them. The diff utility is a data comparison tool that calculates and displays the differences between the two texts.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedImplement your diff utility, i.e., given two similar strings, efficiently list out all differences between them. The diff utility is a data comparison tool that calculates and displays the differences between the two texts.
Write an efficient algorithm to print the two-dimensional view of a binary tree.
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.
Given a string, remove adjacent duplicates characters from it. In other words, remove all consecutive same characters except one.
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 two arrays of positive integers, add their elements into a new array. The solution should add both arrays, one by one starting from the 0th index, and split the sum into individual digits if it is a 2–digit number
Write code to print all combinations of positive integers in increasing order that sum to a given positive number.
Given a string and a pattern, determine if the pattern matches with the string or not. The solution should not use any regex.
Write an efficient algorithm to check if a given string is k–palindrome or not. A string is k–palindrome if it becomes a palindrome on removing at most k characters from it.
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.