+ 1
What is wrong with my code? Task: Mathematics, test cases 4 and 5 failed.
Find which math expression matches the answer that you are given, if you have an integer answer, and a list of math expressions. Task: Test each math expression to find the first one that matches the answer that you are given. Input Format: Two inputs: an integer and a space separated string of math expressions. The following operations need to be supported: addition +, subtraction -, multiplication *, division /. An expression can include multiple operations. Output Format: A string that tells the index of the first math expression that matches. If there are no matches, output 'none'. Sample Input: 15 (2+100) (5*3) (14+1) Sample Output: index 1 https://code.sololearn.com/ciORXrxX0Z5B/?ref=app
9 Respuestas
+ 1
https://code.sololearn.com/cGY3Qgx3fj6Z/?ref=app
try this it's giving warning instead of int in for loop u need to use
long unsigned int
And check your input formats
+ 1
Now check again I have modified the code little it's working fine for your given input I have tested well I have changed line no 49
15
(2+100) (5*3) (14+1)
+ 1
Can you please provide the whole test cases and constraints
+ 1
No, because I don't have PRO account so I can't see some test cases. I can see that they failed only.
+ 1
This question is from code coach..?
0
Thanks, but it still doesn't work
0
Yes, that's true, it works for this input from example but test case 4 and 5 still fail.
I don't know the contents of this test cases.
0
Free or PRO, the test cases that are locked are still the same.
0
Yes, it is from Code coach