Frage im Vorstellungsgespräch bei Amiq

one string problem from the online test (replacing text between non nested brackets)