You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Write a JavaScript program to find the maximum possible sum of some of its k consecutive numbers (numbers that follow each other in order) in a given array of positive integers.
const prompt = require("prompt-sync")();
console.log("Enter the size of the Array : ");
var size = parseInt(prompt());
var arr = [];
console.log("Enter the Array Elements : ");
for (let i = 0; i < size; i++) {
console.log(`[${i}] : `);
var elem = parseInt(prompt());
arr.push(elem);
}
console.log("\n");
console.log("Enter the Elements you want the max Sum : ");