Ad
  • Custom User Avatar

    There is always a consideration between using memory and speed. You should know that finding an index of a character in a string takes 0(n), compared to using a dictionary to store already computed values. Knowledge before commenting is crucial!

  • Custom User Avatar

    A perfect example of overthinking and making things complex for no reason.

  • Custom User Avatar

    There is several ways for this kind of work. But it depends on the language you are using. As an example, in c# there is a string function called Insert(). Using that function you can easilly do this task. There is some equivallent functions in most of the language. You should consult the respected documentation.