const s : string = "typescript php python c++ c c# java"
let max : string = "";
let min : string = s;
const words : string[] = s.split(" ");
for (var i = 0; i < words.length; i++) {
if (words[i].length > max.length)
max = words[i];
if (words[i].length < min.length)
min = words[i];
}
console.log("Largest word: " + max);
console.log("Smallest word: " + min);
/*
run:
"Largest word: typescript"
"Smallest word: c"
*/