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

What is the prime factorization of 245? A) 5 × 49 B) 7 × 35 C) 5 × 72 D) 52 × 9
Simplify the rational expression. 5x - 40 / 64 - x^2
Question 1 (1 point) Question 1 Unsaved Escoge la traducción correcta. - friend, pal Question 1 options: pana el pan chido bacán Save Question 2 (1 point)
Do all animals have the same life span? Explain your answer
The role of women in the family has changed dramatically within the u.s. during the last 50 years. women have furthered their education and developed careers. t
Imagine you are stranded on a deserted island with 400 individuals. Once you and the others have built some shelters and taken stock of the island, how would yo
The court is in the shape of a rectangle. Its length is 46 feet and its width is 35 feet. Suppose each can of wood stain covers 115 square feet. How many cans w
Which early political party was led by Jefferson and Madison? A. Labor B. Federalists C. Democratic Republicans D. Whigs
Use Substitution to solve the system of equations. c+b=12 2b-3c=1 1/2
Who created an engraving of the Boston Massacre to increase support for the Patriot cause