LinkedIn interview question

game design, DP, string manipulation