AlgoUniversity
  • Go Back
Discussion
Expression Evaluation :

Author

HARSH PRIYADARSHI

Difficulty Level : Medium

Submissions : 59

Asked In :

Marks :10

: 0 | : 0

You are given a String in Infix form. You have to evaluate the expression given and print the value of the expression. You can assume that operations are integral i.e (5+7/2) doesn't exist. The operands that exist are (+,-,*,/,()).

Input

A single line containing a string in Infix form.

Output

A single integer containing the value of the expression.

Example

Input
1 + 3 - 5 * 2
Output
-6

Note

Here, we can see that corresponding postfix expression would be 1 3 + 5 2 * -

Resulting value would be -6.

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.