SenseTime Interview Question

Two medium coding challenge on DP.