Given an array of integers, find the remainder when the product of all the elements is divided by N
Solution Stats
Problem Comments
6 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers14
Suggested Problems
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13590 Solvers
-
428 Solvers
-
Create Vector containing following elements
142 Solvers
-
Rotate counterclockwise a matrix 90 deg with left-bottom element
163 Solvers
-
Determine if a row vector has NaN
134 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think answer to test case #4 is correct, though #5 and #6 are incorrect.
Can you clarify what is the answer you are getting for 5 & 6.
So far I can tell, they are correct. Others have also solved it nicely.
Results from Wolfram alpha -
#5 = 8
https://www.wolframalpha.com/input?i=mod%28124*134*23*49*235*13*1298323*1264*92188212*9928381832*12723812313%2C199%29
#6 = 1036
https://www.wolframalpha.com/input?i=mod%28124999112*13414123356262*2312414*4912412*235124124*131298*1298323*1264*92188212*9928381832*12723812313%2C1990%29
You can also use symbolic or BigInteger and show they are incorrect.
@dyuman joshi
Okay. I see. Maybe I missed something - gotta look at the theories. I will do that later.
thanks for pointing it out.
Test suite has been corrected and solutions are rescored.