Hackerank solutions