CoolMind


If you cannot measure it, you cannot improve it.

Minimum number of rooms required

Problem Solution Complexity analysis Problem This problem was asked by Snapchat. Given an array of time intervals (start...

Enum in Cpp and Python

Enum is very commonly used both in cpp and python. In this blog, we will introduce enumeration in cpp and python. Cpp Unscoped enumer...

Intersecting node of two lists

Problem Solution Problem This problem was asked by Google. Given two singly linked lists that intersect at some point, find the intersecti...

Minimum cost to color houses

Problem Solution Problem This problem was asked by Facebook. A builder is looking to build a row of N houses that can be of K different co...

Sliding maximum of range k subarray

Problem Solution Complexity analysis Problem This problem was asked by Google. Given an array of integers and a number k...

Longest file path size

Problem Solution Problem This problem was asked by Google. Suppose we represent our file system by a string in the following manner: The ...

Fixed size queue

Problem Solution Problem This problem was asked by Twitter. You run an e-commerce website and want to record the last N order ids in a log...

Pick a number randomly from an unlimited stream

Problem Solution Comments Problem This problem was asked by Facebook. Given a stream of elements too large to store in memory, pick a ra...