Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

Sunday common C++ interview problem: Valid parentheses sequences. Given n pairs of parentheses, generate all valid combinations of these parentheses. Solve it yourself: https://lnkd.in/ehZw8NuQ Solution: https://lnkd.in/e2-f5kbC #cpp #cplusplus #coding #programming #dailybiteofcpp

  • No alternative text description for this image
Cassio Neri

Hedge Fund14K followers

2y

To solve this problem I wrote, arguably, the most interesting 7 lines of code of my entire life. You can see it at the link below but a note of caution is necessary: do not try that at home (or production). It might hurt you. https://arxiv.org/abs/1602.06426v2

use stack from algorithm. Push all opened brackets and pop closed of course check correct

See more comments

To view or add a comment, sign in

Explore content categories