Professional Documents
Culture Documents
Word Length SBT
Word Length SBT
Word Length SBT
import scala.io.StdIn
object WordLength {
println("Word lengths:")
println(s"$word: $length")
}
// Function to find the word with the highest length
def findLongestWord(words: Array[String]): String = {
words.maxBy(_.length)
Output-