Answers for "Given an array arr of integers, check if there exists two Input"

0

Given an array arr of integers, check if there exists two Input

var checkIfExist = function(arr) {
     for(let i=0;i<arr.length;i++){
         let target = arr[i]
         for(let j=i+1;j<arr.length;j++){
             if(target === arr[j]*2 || target === arr[j]/2){
                 return true
             }
         }
     }
     return false
 };
Posted by: Guest on March-19-2021

Code answers related to "Given an array arr of integers, check if there exists two Input"

Code answers related to "Javascript"

Browse Popular Code Answers by Language