coderz.py

Keep Coding Keep Cheering!

Largest Sum of Non-Adjacent Numbers

Problem Statement (Asked By Airbnb) Given a list of integers, write a function to compute the largest sum of numbers such that no two numbers are adjacent in the list. The input may contain zero or negative values. For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10, since we […]

January 7, 2025 | Airbnb, dsa, DSA Sheet | No comments

Advertisement