These problems test your ability to translate a problem's rules directly into code.
-
Team (231A)
Rating: 800
Topic: Simple LoopHint
For each problem, sum the three inputs (0s and 1s). If the sum is 2 or greater, add 1 to your answer. -
Stones on the Table (266A)
Rating: 800
Topic: String IterationHint
Iterate through the string from the first to the second-to-last character. Compare each character `s[i]` with the next one `s[i+1]`. If they're the same, increment a counter. -
Queue at the School (266B)
Rating: 900
Topic: Array SimulationHint
You need to simulate the process `t` times. In each second, iterate through the queue and find all adjacent "BG" pairs to swap. Be careful not to swap a newly moved 'B' again in the same second. -
Nearly Lucky Number (110A)
Rating: 800
Topic: Digit ManipulationHint
First, count the number of '4's and '7's in the input number. Let this count be `c`. Then, check if `c` itself is a lucky number (i.e., 4 or 7). -
Two-gram (977B)
Rating: 900
Topic: Substring CountingHint
Iterate through all substrings of length 2. Use a map or dictionary to store the frequency of each two-gram. Then, find the one with the highest count.