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

which of the following is not true in a dialation?
Jack is 5 times younger than her mother. In 6 years, Jack will be three times younger than her mother. How old is each now?
sentence re-ordering please. solve it fast
why is it important to be an active participants in society?
The vertical axis is called the x-axis and the horizontal axis is called the y-axis. The entire plane containing these is called the xy-plane TRUE OR FALSE
(50 POINTS) Set the ball and the barrier about two feet apart on the table. Grasp both ends of the ruler. Push the ball using the center of the ruler so the b
what is the range if the function in this table?
out of 40 chocolates, ram and i shared in the ratio 1:3 . how many chocolates did ram get?
Correct the one error. COMPLEMENTARY ADMISSION FOR TEACHERS AND STUDENTS
12,192÷48 long division