Finding the percentage on hackerrank