Marks :30
: 4 | : 1
Bob has $$$N$$$ chocolates in his refrigerator to which he gives special value. He performs some operations on the chocolates. In each operation, he takes one or more chocolates that are lying in a continuous manner. He then finds and notes down the minimum special value of a chocolate in that group of chocolates. He performs this operation for all groups of chocolates he could find.
The task is to find the sum of all the numbers he had written.
The first line contains an integer $$$N$$$. The second line contains an array $$$A_{i}$$$ representing the special value of chocolates.$$$(1 \le N,A_{i} \le 10^5).$$$
The desired sum.
2 3 4
10
5 1 1 1 1 1
15
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.