Write a program that outputs all possibilities to put + or - or nothing between the numbers 1, 2, …, 9 (in this order) such that the result is always 100. For example 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 = 100
test the program using the following procedure: stack of size n=6 1. call push(5) 2. call push(2) 3. call push(3) 4. call pop() 5. call push(6) 6. call push(9) 7. call push(3) 8. call display() 9. call top()
By Kristi Labadie at Apr 20 2021
0
Given an array, choose two contiguous non-overlapping arrays, such that all elements are strictly increasing. Return the maximum length possible for this combination. Ex: 7 1 2 4 6 5 3 8 9 10 => ans: 7 (Choose 1 2 4 6 & 8 9 10) l
function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers 3 for (let num of nums) { 4 if (num > max_num) { 5 // (Fill in the missing line here) 6 } 7 } 8 return max_num; 9 }