Algorithm · Shopify · Medium
Create a lightweight command-line text editor whose buffer starts empty. The program must handle appending text, deleting characters from the buffer's end, and displaying the current contents in several formats. Commands APPEND s: Add s after the current buffer contents. The string s may include spaces. REMOVE k: Delete the final k characters from the buffer. It is guaranteed that $$0 \le k \le$$ the current buffer length. PRINT format: Display the buffer using one of these…
Checking your access…