Ch-MANASA19 / Ch-MANASA19/Java

Maximum Sum of Non-Adjacent Elements

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1
Forks
7
PR merge metrics
No merged PRs in 30d

Description

📋 Problem Description

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

You can only choose elements that are not next to each other. The goal is to maximize the total sum of chosen numbers.

Example 1

Input: nums = [3, 2, 7, 10]
Output: 13
Explanation: Choose elements 3 and 10 → sum = 13.

I WOUD LIKE TO WORK ON THIS

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.