Streamer Takahashi

ABC 414

Problem 2 of 50

Easy

What to do

A streamer broadcasts from hour `stream_start` to hour `stream_end`. Each listener has a time window [start, end] they can watch. Count how many listeners can watch the entire stream (their start <= stream_start AND their end >= stream_end).

Key Concepts

if-statements loops basic math input/output

Examples

Input: stream_start = 19, stream_end = 22, listeners = [[17, 23], [20, 23], [19, 22], [0, 23], [12, 20]]

Output: 3

Input: stream_start = 12, stream_end = 13, listeners = [[0, 1], [0, 1], [0, 1]]

Output: 0

Tips for Beginners

  • Focus on understanding the logic, not memorizing syntax
  • Use print statements to debug your code
  • Don't worry about input parsing - the function handles that for you
  • If stuck, try writing out your solution on paper first

Python Editor

Loading Python...