Results for “standard”
Small, practical examples. Search by task or narrow things down below.
Count matching values
Count even numbers in a fixed C array.
C✓ Tested
Count newline characters
Count newline bytes in a C file while retaining EOF as an int.
C✓ Tested
Count occurrences in a list
Count how often each value appears using Counter from the standard library.
count✓ Tested
Count repeated words
Count repeated words using a complete Go program with explicit sample inputs.
Go✓ Tested
Count the items in a collection
Python: Read the collection’s length instead of hard-coding the loop limit.
Python✓ Tested
Count the items in a collection
C#: Read the collection’s length instead of hard-coding the loop limit.
C#✓ Tested
Count the items in a collection
Java: Read the collection’s length instead of hard-coding the loop limit.
Java✓ Tested
Count Unicode code points
Java: Use codePointCount when supplementary characters should count as one rather than two UTF-16 units.
Java✓ Tested
Count Unicode code points
Count Unicode code points using a complete Go program with explicit sample inputs.
Go✓ Tested
Count values with the entry API
Count values with the entry API in a complete Rust program using the standard library.
Rust✓ Tested
Count whitespace-separated words
Linux Commands: Use wc -w with standard input to omit the filename column.
Linux Commands✓ Tested
Count word frequencies
Use Map.merge to count repeated words in Java.
Java✓ Tested