I' m really stuck here... I cannot get my algorithm to work, all my attempts fail on the 5th example... Any hint will be trully appreciated...