Skip to content
C

House Robber

Mediumjavapythonccppjavascript

Given the money in each house along a street, find the maximum amount you can collect without robbing two adjacent houses.

Input Format

The first line contains an integer N. The second line contains N space-separated non-negative integers.

Output Format

Print the maximum amount that can be robbed.

Input (stdin)

Output

Run your code to see output here...