Words Score Hackerrank Solution Python