Ad
  • Custom User Avatar

    I'm not quite sure what you're trying to say. You are correct when you say, "There is no [guarantee] that the number will be [in] the same spot in the name." You will have to find some way to search through the string to find it. This is an exercise to test your understanding of string manipulation.

    There is a hint given that the number which corresponds to the quote in the array, is somewhere AFTER the first three characters of the name. You are also guaranteed that the quotes either belong to Robin, Joker, or Batman. No other characters are listed. So given that information, you need to think of a clever way to figure out who the quotes in the array belongs to, knowing that the number in the provided string corresponds to the quote's index. In that sense, this problem is also an exercise of problem solving.

    The only "hardcoded" part of the solution you must provide is the format for the output.

  • Custom User Avatar

    There is no way how to automaticaly evaluate name. If it is Robin, Joker, Batman or who else it could be. There is no garantie, that the number will be on the same spot in the name, or that in the aray will be the quotes always in the orther Batman, Robin, Joker. Because of this the name part must be always hardcoded which is not correct.