Maximum Number of Words Found in Sentences LeetCode solution in JavaScript
1/**2* @param {string[]} sentences3* @return {number}4*/5var mostWordsFound = function (sentences) {6let max = 0;7let temp = 0;8for (let i = 0; i < sentences.length; i++) {9temp = sentences[i].split(" ").length;10if (temp > max) {11max = temp;12}13}1415return max;16};