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

evaluate each piecewise function at the given values of the independent variable. 53.
Our students are going to stage a threatre in the college hall. Choice the error.
Binding the blade on the reciprocating saw may cause:a) Increased cutting speedb) Overheating of the sawc) Blade breakage or bendingd) Improved cutting precisio
Which of the abbreviations would be a correct reflection of the following Emergency Department note? ; Physical Exam ; Vital Signs: Temperature: 102.3; Heart Ra
What are some behaviors and responses that may indicate limited literacy?
seventh graders collect some gold sand on a class field trip class 7a collect 40 oz of gold sand that contains 12% class 7b collected 55 oz of gold sand that co
Let A = {4, 6, 7, 8, 9, 10} and B = {7, 9, 10}. Indicate if each statement is true or false. 1 ∈ A B ⊂ A
How does the US fare with the stance taken by the UN?
Tell me about a time that you went out of your way to help out a teammate.
At the least, how many feet of final earth cover should you use when abandoning a sanitary landfill trench?a. 1.b. 2.c. 3.d. 4