I think the benefit of the exercise is come up with an algorithm that solves the problem given your available skillset. If the OP understands algorithms and was able to find equal and use it, then I'd say great. But otherwise, identifying a series of steps to accomplish the task is what programming is all about.
The string is just the vehicle. It's pretty irrelevant to the task in my eyes.