CoolMind


If you cannot measure it, you cannot improve it.

Leetcode summary of 20200301-20200308

Summary Highlight Code Section Summary It is a little busy this week. So the summary is a little late. Solved problems list 1185. ...

Python contextlib

There are some resources we need to release when we finish our job. It is easy for us to forget those operations. Python has a keyword with which c...

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