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

A drawing of a surfboard in a catalog shows it's length as 8 4/9 inches. Find the actual length of the surfboard if 1/2 inch length on the drawing corresponds t
how did other nations contribute to the american revolution?
how would your weight change on the surface of an earth sized planet whose mass was greater than earths? why?
What modern day country is located where Mesopotamia was located
What are the prime numbers of numbers 1-49?
A 100 centimeter stick broke into 3 pieces one piece was 7 centimeters long and another was 34 centimeters long how long was the third piece
The concert lasts 60 minutes, and the songs are all the same length. The choir sings a total of 12 songs, 2 of which are sung by the sopranos only. For how many
$10 + ($6-n) if n =$3 What is the final product Of this mathematical question?
How do I solve this problem 7x<14 and 1-x<4
choose the plural noun that's spelled correctly?A Fathers-in-lawD Editor in chiefs