We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If they had included a test case in which they appended 1 character 10^6 times (which falls within the problem constraints), you would have had to store around 10^12 bytes (1TB) in memory, far larger than is allowed on here. Apparently they didn't push the test cases to the limit.
That being said, I think your solution is pretty cool, and I would say that it absolutely does use the stack concept.
Simple Text Editor
You are viewing a single comment's thread. Return to all comments →
If they had included a test case in which they appended 1 character 10^6 times (which falls within the problem constraints), you would have had to store around 10^12 bytes (1TB) in memory, far larger than is allowed on here. Apparently they didn't push the test cases to the limit.
That being said, I think your solution is pretty cool, and I would say that it absolutely does use the stack concept.