JavaBasicPrograms icon indicating copy to clipboard operation
JavaBasicPrograms copied to clipboard

Add this interesting question

Open Adityakumar37 opened this issue 1 year ago • 1 comments

📝 Problem: Maximum Sum Such That No Two Elements Are Adjacent

Given an array of positive integers, find the maximum sum of elements such that no two elements are adjacent.

🎯 Examples:

Input: nums = [3, 2, 7, 10] Output: 13 Explanation: Pick 3 and 10 => 3 + 10 = 13

Input: nums = [3, 2, 5, 10, 7] Output: 15 Explanation: Pick 3 + 5 + 7 = 15

Adityakumar37 avatar Oct 22 '25 15:10 Adityakumar37

Thank you for assigning me! Made a PR for this.

Adityakumar37 avatar Oct 23 '25 17:10 Adityakumar37