That doesn’t work for all Unicode characters. IMO the exercise is badly made if solution is intended to be Unicode-unsafe.