1. 程式人生 > >Practice Go: Reverse Parentheses @ Alex Pliutau's Blog

Practice Go: Reverse Parentheses @ Alex Pliutau's Blog

Reverse Parentheses

Complete the function that reverses characters in (possibly nested) parentheses in the input string. Input strings will always be well-formed with matching ()s.

Examples

(bar)             => rab
foo(bar)baz       => foorabbaz
foo(bar(baz))blim => foobazrabblim

Run tests with benchmarks

go test -bench .