You are given a path to a file as a string. The path can contain the symbols: “..” for the parent directory and “.” for the current directory. Convert the path into its simplified form.
Given a binary tree, extract all the leaves in repeated succession into a list of lists by starting at the bottom and working your way upwards.
Write a program to reverse the given string.
Given a two-dimensional binary matrix where 1 represents water and 0 represents land, mutate the matrix in place and return the matrix with the highest peak maximized.
Given an array of integers, transform the array in-place to a max heap.
Given a 32-bit signed integer, reverse digits of the integer.
Given a non-empty array of integers, return the k most frequent elements
Given a string s, find the length of the longest substring without repeating characters.
Given an unsorted array of integers and an integer k, find the number of subarrays whose sum equals k.
You are given a list of lexicographically sorted words from an alien language. This language has a unique order. Return the alphabetical order of all the letters found in the list of words.
Design and implement an efficient sampler that works in average O(1) time complexity.
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure.
Given `n` pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Given a list of meetings, represented as tuples with a start and an end time, determine the minimum number of rooms required to schedule all the meetings.
Given a list of integers L and a number K, write a function that reorganizes L into three partitions: elements less than K, elements equal to K, and elements greater than K. No additional lists may be used.
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
Given an integer array and an integer k, return the kth smallest element in the array.
Given an array of integers, return an array of triplets such that i != j != k and nums[i] + nums[j] + nums[k] = 0.
Given a 2D matrix, where "1" represents land and "0" represents water, count how many islands are present.
Given an array of integers, return the indices of the two numbers that add up to a given target.
Given a list of tuples that represent (X, Y) coordinates on an XY plane and an integer K, return a list of the K-closest points to the origin (0, 0).
Given the head of a linked list, reverse the list and return the new head.
Given the root of a complete binary tree, return the number of nodes in the tree.
Given an encoded string, return its decoded string.
Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.
Given an input string `s`, reverse the order of the words without reversing the words themselves.
The boundary of a binary tree is the concatenation of the root, the left boundary, the leaves ordered from left-to-right, and the reverse order of the right boundary.
Given a linked list with nodes that have an additional pointer referring to another node in the list, return a deep copy of the list.
Given two strings, return the longest common subsequence between the two strings.
Given an unsorted array of unique integers (size n + 1) and a first array identical to the second array but missing one integer (size n), find and output the missing integer.
Given n non-negative integers, find two lines that form a container that can hold the most amount of water.
Interview prep and job hunting are chaos and pain. We can help. Really.