Paint Bucket
You are given a two dimensional array matrix, containing strings “r”, “g”, and “b”. Perform a floodfill operation at row r, column c with the color target.
You are given a two dimensional array matrix, containing strings “r”, “g”, and “b”. Perform a floodfill operation at row r, column c with the color target.
You are given a string s containing lowercase alphabet characters separated by spaces " ". After splitting the string on spaces, return all the words in vert...
Given an integer n, return the minimum number of Fibonacci numbers required to sum up to n.
You are given a binary tree root which is almost a binary search tree except two nodes’ values have been swapped. Return the original binary search tree.
Given a binary tree root, return the largest sum of a subtree that is also a binary search tree.
Given a list of positive integers nums, return whether you can partition nums into two groups where the sum of the elements in both groups is equal.
Given a string s and an integer k return whether you can delete at most k characters such that after the deletion s is a palindrome.
You are given a list of integers piles and an integer k. piles[i] represents the number of bananas on pile i. On each hour, you can choose any pile and eat r...
Given a binary tree root, return the longest path between any two nodes in the tree.
Given a two-dimensional integer matrix of 1s and 0s, return the number of distinct “islands” in the matrix. A 1 represents land and 0 represents water, so an...
You are given a list of integers nums representing tasks that you must get through in order. Each value represents the amount of time it takes to finish that...
You are given a two-dimensional integer matrix of 1s and 0s. A 1 represents land and 0 represents water. From any land cell you can move up, down, left or ri...