cswork / OAOpen practice workspace

PinterestOA #6

Minimize Expression with Parentheses

Estimated MediumStatement and editorial — judging is being prepared

Topics (AI-labelled)StringsEnumeration

You are given a string expression</

Example 1

Input:

expression = "1639+5628"

Output:

"16(39+5)628"

Explanation: Placing the parentheses around 39+5 gives the minimum value among all valid choices for this expression.

Editorial

Loading solution…