Pergunta de entrevista da empresa Improving

Java trivia and 1 easy LC style question. Write a function that takes a String and returns the number of characters in the longest matched set of(), [], or {}. For example, the String “(1[234)567]” would return 9, and the String “()” would return 2.