Min Max Value Expression

easy
1. You are given a string that represents an expression containing numbers and two operators + and *.
2. You have to find the minimum and maximum value which can be obtained by evaluating this expression by different parenthesization.

Input Format

A string

Output Format

Check the sample output and question video.

Constraints

1 <= length of string <= 100
Range of numbers -> [0,9]

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
1+2*3+4*5
Output
Minimum Value -> 27
Maximum Value -> 105
Previous
Burst Balloons
Next
Cut Paper Into Squares

Related Questions