In the given solution they don't use substring but a char array. Is it because of this?