Published on

Maximum Number of Words Found in Sentences

Authors

📝 Vazifa tavsifi

Sizga satrlar massivi sentences berilgan. Har bir element so'zlari orasida bo'sh joy bo'lgan bitta gapni bildiradi.

Jamlangan so'zlar bo'yicha eng ko'p so'z qatnashgan gapni topib, uning ichidagi so'zlar sonini qaytaring.

Misol:

Input: sentences = ["alice and bob love leetcode", "i think so too", "this is great thanks very much"]
Output: 6
Tushuntirish:
1-gap: 5 so'z
2-gap: 4 so'z
3-gap: 6 so'z. Maksimal so'zlar soni 6 ga teng.

Maximum Number of Words Found in Sentences

Oson5 daqiqa10 ball

📚 Misollar

Kiruvchi: sentences = ["alice and bob love leetcode", "i think so too", "this is great thanks very much"]
Chiquvchi: 6
func solve(_ sentences: [String]) -> Int { // Kodingizni shu yerga yozing return 0 }

Run tugmasini bosing

Buy mea coffee