nia850
nia850 nia850
  • 21-09-2020
  • Computers and Technology
contestada

Create the code that will find
the longest word of the given
string. You are not allowed to
use split() method

(python)

Respuesta :

johnsong14306
johnsong14306 johnsong14306
  • 21-09-2020

Answer:

function findLongestWord(str) {

 var longestWord = str.split(' ').sort(function(a, b) { return b.length - a.length; });

 return longestWord[0].length;

}

findLongestWord(InputHere);

Explanation:

Replace InputHere with the input

Answer Link

Otras preguntas

Pls I still have to do wayyyyyyy more hw and I need the answers for atleast this one
When devin asks if you like his new outfit and you, realizing devin is seeking a positive affirmation on his change of style, reply with, "yeah! it looks great!
An iv curve is generated for two ohmic devices, one is a good conductor and the other is a good insulator. which one will have a lower slope?
Find the value of x in each case:
What does this app do?
I a collect like term what is 4p+3q-3p-3q
Comentati intrun eseu o maxim de o pagina , afirmatia A citi inseamna a descoperi calea de acces la sufletul cartilor
Why are horses and donkeys considered the same species even though they can produce offspring
Find the values of c such that the area of the region bounded by the parabola y = 16x2 − c2 and y = c2 − 16x2 is 250/3. (Enter your answers as a comma-separat
Can someone help me please