Implement another similar solution for the new online judge.