snake and ladder hackerrank accepted solution