[Community Puzzle] Remove insert statements

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @nguyen.lam,validated by @Razovsky,@Regulus136 and @Drunkey.
If you have any issues, feel free to ping them.

I think the test cases are missing many edge cases: e.g.

  • the insert, begin, end, or -- strings within a string literal;
  • the insert, begin, end, or ' strings within a comment;
  • multi-line insert with several of its lines ending with a comment (not just after the final ; )
  • nested beginend blocks

I’m afraid writing a proper SQL tokenizer is no longer “easy”… So the text should indeed have mentioned the simplifications made, especially regarding strings.
Other missing tests include spaces before or after a ‘;’, as well as at the start of a line (which has been specifically pointed out as possible for ‘insert’).

:wave: Hi to all, and thanks to @nguyen.lam for this “parsing” puzzle :wink: !
I don’t know yet about SQL requests, but i know a bit about parsing text data using machine state …
→ and this one is not specially a difficult one.

Thanks for this pleasant exercise, and to the Aprovers too (Razovsky, @Regulus136 and @Drunkey) :slight_smile: !

Have sun :sun_with_face: , fun :dark_sunglasses: and CodinGames :keyboard::rofl: !