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 buyer for a computer store paid $194 each for printers. He wants to sell them at 25% markup. What will be selling price of the computer.
Is the most densely populated European nations
NO triangle ONE triangle MANY triangles A triangle with all three angles equal to 45° A triangle with angles measuring 37°, 84°, and 59°. A triangle with sides
Where can the majority of Earth’s freshwater be found? in polar ice caps underground in the ocean in the Great Lakes
15y + 6 factor out the GCF from the binomial
Rewrite in vertex form y=x^2+14x+50 I also need the work
Can a child who is 46 inches tall ride the roller coaster? Explain
The literary style of Proverbs is constant throughout. True False
historians of the past wrote mostly about a. Great battles b. well-known individuals in great heroes c. religious ceremonies and noble deeds d. changes in
A store has a $159.98 item on sale for $79.99, plus an additional 20% off. What is the percentage of savings off on this item?