Text Trimming Operation
Imagine you are developing a text analysis tool that processes strings of characters. You need to implement a trimming process, that removes certain patterns from the beginning and end of the text. The process follows these rules:
Identify a non-empty prefix in the text where all characters are the same.
Identify a non-empty suffix in the text where all characters are the same.
The prefix and suffix should not overlap at any index.
The characters in the prefix and suffix must be identical.
Delete both the prefix and the suffix from the text.
Your task is to determine the minimum length of the text after applying this trimming process any number of times (possibly zero times).
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)