← Questions
Maximum sum of non-adjacent houses, on a line, a circle and a tree
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Each house holds some value and you cannot take two neighbours. Find the best total for houses in a row, then for houses arranged in a circle, then for houses arranged as a binary tree where parent and child count as neighbours.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding


