Please help me with an algorithm for this problem to be able to test on hackerrank! It

Posted Date: