Marks :10
: 10 | : 1
There are $$$N$$$ houses built in a line, each of which contains some value in it. A thief is going to steal the maximal value of these houses, but he can't steal in two adjacent houses because the owner of the stolen houses will tell his two neighbors left and right sides. The task is to find what is the maximum stolen value.
The first line contains an integer $$$N$$$. The second line contains $$$N$$$ integers $$$Arr_{i}$$$ denoting the value of houses.$$$(1 \le N \le 10^5)$$$$$$(1 \le Arr_{i} \le 10^4).$$$
Output maximum stolen value.
3 1 2 3
4
4 5 6 3 10
16
1 9139
9139
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.