给定 target = 7,返回 true。
给定 target = 3,返回 false。
0 <= array.length <= 5001 function Find(target, array) 2 { 3 // write code here 4 for(let i = 0;i<array.length;i++){ 5 for(let j = 0;j<array[i].length;j++){ 6 if(array[i][j]===target){ 7 return true; 8 break; 9 } 10 } 11 } 12 return false; 13 } 14 module.exports = { 15 Find : Find 16 };
原文:https://www.cnblogs.com/icyyyy/p/15302931.html