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

Can someone PLEASE help meeeeee
Find the perimeter of the triangle
How many molecules are in a 45g sample of water?
What is the mass percent when 144 grams of NaCl is dissolved in 255 grams of water?
es ciertoque no tengo dinero y es evidente que la mayor parte de las monedas son de chocolate;pero si cogeis esta hoja,la doblais a lo largo en dos rectangulos,
What are the economic impacts of mining gold? Check all that apply. O It creates a pollution problem. OIt creates a new process for mining. OIt creates health i
First try was incorrect Ivy is making fasnacht (deep-fried German doughnuts) to sell the Tuesday before Ash Wednesday, her bakery's biggest fasnacht day of the
What do you mean by the phrase necessity is the mother of invention?And who said it?
PLEASE HELP The volume of a right rectangular prism can be found by using the product 6(4)(18). Which expression could also be used to determine the volume of
(5x+1)3=15x3 que Propiedad pertenece