John loves Chocolate but he didn't have money. The owner of "Sweet Chocolate" launches a scheme for free chocolate. He divided a day into "n" number of slots. A person has can take the number of chocolates available in the slot with a condition that he has to return the number of chocolates which are available in the slot in which he is returning the chocolates only once in a day. Now this return has to be done on the same day and it can't be done before taking the chocolates. The number of chocolates left after the return is what you get for free. John wanted to try his luck on this, Help him in it.
x->is an array consisting of the number of chocolate available in the different slots of the day.
(the number of slots per day can be got from the size of the array x)
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers10
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15809 Solvers
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
2156 Solvers
-
Create a function handle that reverses the input arguments of another function handle
158 Solvers
-
First non-zero element in each column
963 Solvers
-
40 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!