Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    for example $"hello" it was taken as a normal string

    There are no variables there so, yes, just letters h-e-l-l-o.

    If you print things out from your code to observe what steps are carried out, you can figure out what went wrong.
    For an input of "testing", you get a result of "e" which definitely isn't in the middle. So, which string did you use to find an 'e'? And which index was used? There is an 'e' in that string, so if it's the right string then the wrong index was used. Or if it's the right index, then it would be that the wrong string was used. One or the other.

    When you dig into things and find out what's happening, there is no longer such a thing as a stupid mistake.

    And yeah, you weren't testing the case that the code failed on. "testing"

  • Default User Avatar

    What makes you say $"" doesn't work? Did you read the error messages that you're getting?
    I assume you're using C#, $"" works just fine.
    When you test things locally, make sure you're testing exactly the same thing as is failing here. Usually when I see somebody say "it works in my environment" I assume they didn't test the thing at all, so therefore there was no failure. You could for example copy the example tests and run them, and if something in the real test cases is failing, you could add those to the example tests that you copied.