DP solution in C++ commited on GitHub.com