Word Frequency
Medium📝 Description
Count how many times each word appears in sentence
Input Format
A sentence string
Output Format
word:count (one per line, alphabetical order)
Constraints
Length ≤ 1000
🔍 Sample Input
hello world hello
✅ Sample Output
hello:2
world:1
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run