String.Substring makes it harder to understand?

Why the code is written in such a problematic manner. There are so many easy solutions available for this one.
I dont understand why we need to bring the string.substring ()

Type your question above this line.


Yes, there are a lot of easy solutions to tackle this problem, but we want the solution to be the most efficient. The substring function used will take the minimum time O(1) thus improving our time complexities.

1 Like