CoolMind


If you cannot measure it, you cannot improve it.

Run-length encoding

Problem Solution Problem This problem was asked by Amazon. Run-length encoding is a fast and simple method of encoding strings. The basic ...

Edit distance

Problem Solution Problem This problem was asked by Google. The edit distance between two strings refers to the minimum number of character...

Containing water

Problem Solution Problem This problem was asked by Facebook. You are given an array of non-negative integers that represents a two-dimensi...

K node from end

Problem Solution Problem This problem was asked by Google. Given a singly linked list and an integer k, remove the kth last element from t...

Bracket match

Problem Solution Problem This problem was asked by Facebook. Given a string of round, curly, and square open and closing brackets, return ...

Regular expression match

Problem Solution Problem This problem was asked by Facebook. Implement regular expression matching with the following special characters: ...

Lock or unlock a binary tree

Problem Solution Problem This problem was asked by Google. Implement locking in a binary tree. A binary tree node can be locked or unlocke...

Minimum steps to reach

Problem Solution Problem This problem was asked by Google. You are given an M by N matrix consisting of booleans that represents a board. ...