Works with a for loop but only for up to 4 characters
Works for most cases
Getting closer
Seems to be working
Fails for one test that needs to be taken into account
Works for all tests
Added codingbats solution