Light Mode
Dark Mode
why its not working here?

Please help what's wrong? The code is working fine with example tests but while checking the code it fails. Below is my code..

let arr=text.split(' ');
  let counter=0;
  for(let i=0;i<arr.length;i++){
     if(isNaN(arr[i])){
       counter++;
       if(counter===3){
         return true
       }
     }
     else {
       counter=0;
     }
  }
  return false;

Wrapped in function..

Created: April 17, 2022, 10:22 a.m.
Updated: April 23, 2022, 9:25 a.m.
0
4
User avatar
surajshahgarh