Maximum sum from any 2 numbers with a variable number of inputs - MATLAB Cody - MATLAB Central

Problem 43091. Maximum sum from any 2 numbers with a variable number of inputs

Difficulty:Rate

Given a variable number of inputs, combine any 2 numbers from the inputs and output the maximum sum the combinations can generate. For example:

x = 3;
y = 5;
z = 1;
y_correct = 8;

Solution Stats

41.13% Correct | 58.87% Incorrect
Last Solution submitted on Nov 11, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers56

Suggested Problems

More from this Author43

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!