CoolMind


If you cannot measure it, you cannot improve it.

Lower bound and upper bound of set/map

STL’s map/set/multimap/multiset is an ordered container which compares to unordered_map and unordered_set. So there are special methods which imple...

Move subdirectory of a git repository and keep commit message

How to extract a subdirectory of a git repository and keep its commit message? If we directly move everything and add them again, we will lose all ...

Leetcode summary of 20200223-20200301

Summary Highlight Code Section Summary Solved problems list 187. Repeated DNA Sequences 201. Bitwise AND of Numbers Range 166. ...

Ugly number I and II

Ugly numbers are numbers which only divided by 2, 3, 5. By default 1 is also a ugly number. Ugly Number I Ugly Number II Summary Related ...

Leetcode summary of 20200217-20200223

Summary Highlight Code Section Summary Solved problems list 393. UTF-8 Validation 200. Number of Islands 138. Copy List with Ra...

How to exit nested loops

Introduction Use a bool flag Use goto Use lambda function Introduction Recently when solving 999. Available Captures for Rook, I need t...

Leetcode summary of 20200209-20200216

Summary Highlight Code Section Summary Most of the problems solved are easy ones. Leetcode’s problem collection is increasing too fast....

Common functions implemented using STL

Introduction Count lines String trim Convert case Split and Join strings Filter Map Reduce Introduction STL provides a lot of u...