Binary Tree Column Order Traversal
Given a binary tree, return its column order traversal from top to bottom and left to right. Note: if two nodes are in the same row and column, order them from left to right.
Given a binary tree, return its column order traversal from top to bottom and left to right. Note: if two nodes are in the same row and column, order them from left to right.
This question is asked by Amazon. Given two strings, passage and text, return whether or not the characters in text can be used to form the given passage.
This question is asked by Google. Given an array, nums, and an integer k, return whether or not two unique indices exist such that nums[i] = nums[j] and the two indices i and j are at most k elements apart.
Given an integer array nums, return the total number of "partners" in the array.
Given an array of integers nums, each element in the array either appears once or twice. Return a list containing all the numbers that appear twice.
Given a binary search tree, return its mode (you may assume the answer is unique). If the tree is empty, return -1.
A frog is attempting to cross a river to reach the other side. Within the river, there are stones located at different positions given by a stones array (this array is in sorted order). Starting on the first stone (i.e. stones[0]), the frog makes a jump of size one potentially landing on the next stone. If the frog's last jump was of size x, the frog's next jump may be of size x - 1, x, or x + 1. Given these following conditions return whether or not the frog can reach the other side.
Given an integer n, return whether or not it is a "magical" number. A magical number is an integer such that when you repeatedly replace the number with the sum of the squares of its digits, it eventually becomes one.
Given a list of words, return all the words that require only a single row of a keyboard to type.
You are given two lists of integers and an integer representing a process id to kill. One of the lists represents a list of process ids and the other represents a list of each of the processes' corresponding (by index) parent ids. When a process is killed, all of its children should also be killed. Return a list of all the process ids that are killed as a result of killing the requested process.
Given a string s, return the length of the longest substring containing at most two distinct characters.
Given a string s, return the length of the longest substring that contains only unique characters.
High school students are voting for their class president and you're tasked with counting the votes. Each presidential candidate is represented by a unique integer and the candidate that should win the election is the candidate that has received more than half the votes. Given a list of integers, return the candidate that should become the class president.
Given a string s containing only lowercase characters, return a list of integers representing the size of each substring you can create such that each character in s only appears in one substring.
Given the reference to the root of a binary tree and a value k, return the number of paths in the tree such that the sum of the nodes along the path equals k.
This question is asked by Facebook. Given a string, check if it can be modified such that no two adjacent characters are the same. If it is possible, return any string that satisfies this condition and if it is not possible return an empty string.
Given a string s, return all of its repeated 10 character substrings.
Given a list of words, return the top k frequently occurring words.
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
Given the reference to the root of a binary search tree and a target value, return whether or not two individual values within the tree can sum to the target.
This question is asked by Amazon. Given a string s and a list of words representing a dictionary, return whether or not the entirety of s can be segmented into dictionary words.
Given a string s and a string code, return whether or not s could have been encrypted using the pattern represented in code.