Coding Exercise Posts - page 7 of 43

Recent posts

Paint Bucket

1 minute read

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.

Vertical Word Arrangement

less than 1 minute read

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...

Fibonacci Subset Sum

less than 1 minute read

Given an integer n, return the minimum number of Fibonacci numbers required to sum up to n.

Binary Search Tree Typo

less than 1 minute read

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.

Equal Partitions

less than 1 minute read

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.

Eat Bananas in K Hours

1 minute read

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...

Longest Tree Path

less than 1 minute read

Given a binary tree root, return the longest path between any two nodes in the tree.

Distinct Islands

1 minute read

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...

Skip Tasks to Minimize Work

1 minute read

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...

Enclosed Islands

1 minute read

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...