Skip to content

Add this interesting question #98

@Adityakumar37

Description

@Adityakumar37

📝 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions