Sherlock And Cost Hackerrank Solution