Advertisement
Vassil_Iliev

Electronic message

Mar 14th, 2022
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let string = gets()
  2. string = string.slice(0, -1);
  3. string = string.split(' ');
  4. let substringsWithoutLetters = [];
  5. let substringWithoutNumbers = []
  6. let substringWithoutSpaces = [];
  7. let lengthsArray = [];
  8.  
  9. for (let i = 0; i < string.length; i++) {
  10.     substringsWithoutLetters.push(string[i].replace(/[A-Za-z]/g, ''));
  11.     substringWithoutNumbers.push(substringsWithoutLetters[i].replace(/\d/g, ''));
  12.     lengthsArray.push(substringWithoutNumbers[i].length)
  13. }
  14. print(Math.max(...lengthsArray))
Advertisement
RAW Paste Data Copied
Advertisement