bivuze ko bakiri bake cyane this is a problem closely related to the longest common subsequence problem grab your pitchforks