Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.72 KB

File metadata and controls

28 lines (22 loc) · 1.72 KB

Implementation & Simulation Problems

These problems test your ability to translate a problem's rules directly into code.

  • Team (231A)
    Rating: 800
    Topic: Simple Loop

    HintFor 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 Iteration

    HintIterate 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 Simulation

    HintYou 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 Manipulation

    HintFirst, 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 Counting

    HintIterate 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.