We have given a mathematical string consisting of only numbers, '+', '*' and '-'.
Now teacher will award 5 marks is expresiion was solved correctly, 2 Marks if there was mistake in applying the BODMAS, else 0
You have been given number of students, a string, and answer of each student
Find the sum of total marks all students get.
Testcase:
Input:
5
15*4-3*2
11 14 54 300 1000 0
Output:
5Constraints:
0 <= num of students <= 1000
1 <= string len <= 30
-10^9 <= student_answer[i] <= 10^9
Can I get how to approach this ques?
I thought of generating correct answer and all wrongs ans using something wrong in BODMAS
But was not able to code it.