Aboard the starship Celestia, Captain Orion paces the bridge as the navigation core flickers with warning lights. The ship's AI, ARIA, has detected an anomaly in the data stream — a corrupted sequence of values that threatens to send the vessel off course into the void. In the depths of space, there are no second chances, and the crew is relying on a single brilliant algorithm to save them. This is a Quantum Coder level mission, designated "Longest Substring Without Repeating Characters". Only those who have mastered the fundamentals of computation are allowed to touch the navigation core. The ship's computer awaits your command. Read a string S from standard input and print the length of the longest substring without repeating characters. ARIA beeps insistently, displaying the mission constraints on the holographic panel: 0 <= |S| <= 50000 For calibration, the engineers have uploaded these test scenarios into the simulation buffer: Input: abcabcbb Output: 3 The vacuum of space is unforgiving. Captain Orion grips the armrest, watching the countdown tick closer to disaster. Your program must run flawlessly under the strict time and memory limits of the starship's aging hardware. Write the code that will bring Celestia home. The stars are watching. The path to mastering Longest Substring Without Repeating Characters is not one that can be walked in a single step. It demands patience, precision, and a deep respect for the boundaries that shape the problem. Many adventurers before you have attempted this trial and failed, their code crashing against the very constraints that the elders inscribed. But you have the tools. You have the training. You have reached the Quantum Coder tier, and that alone means the council believes in your potential. Look once more at the examples above. Trace the logic with your finger if you must. Consider the time and memory limits carefully, for they are not suggestions but strict laws of the arena. When you are ready, commit your solution. Let the compiler run. Let the test cases judge your work. If your code is true, the gates will open and you will move closer to the ultimate rank. If not, study the failure, sharpen your algorithm, and try again. For in the halls of CodeTikki, the only thing more important than success is the wisdom gained from the attempt. Remember that the Quantum Coder challenge is designed to test not just knowledge, but character. Every edge case is a lesson. Every time limit is a teacher. Every hidden test is a guardian at the gate. Do not rush. Let your code breathe. Let it be as clean as a mountain stream. When the final test passes, you will know that you have earned the title. Until then, code with courage, test with care, and never stop learning.
Constraints:
0 <= |S| <= 50000
