Digits In A String Hackerrank Solution