digital wallet hackerrank solution