Given an array of integers, find the pair of adjacent elements that has the largest product and return that product

前端 未结 5 1977
情书的邮戳
情书的邮戳 2021-01-19 12:22

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.

and here is my code

function ad         


        
5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-19 12:46

    You could start with a really large negative value, instead of zero.

    var p = -Infinity;
    

提交回复
热议问题