The Battle Royale Game X90735


Statement
 

pdf   zip

html

Input

The input will be: * The size of the map given as maximum rows and columns (only squares are valid 3x3,4x4,5x5 etc). * The match time in minutes in which we want to evaluate the number of players remaining. * Several positions on the map, representing the player’s position at the beginning of the match. (T=0 min) The process should stop reading player’s position when the program finds the character ’#’.

    4 4 15 1 2 3 3 #    

In this example the first line describes that this is a 4x4 map. The second line refers to 15 minutes from the start of the match. The third line provides the position of a player on row 1 and column 2. At the fourth line another player position is set on row 3 and column 3. Finally the character ’#’ marks stop reading input file.

Output

The output will be the number of players that remain in the match at that specific point in time.

Public test cases
  • Input

    4 4
    15
    1 2
    3 3
    #

    Output

    1
    
  • Input

    8 8
    25
    3 4
    2 1
    5 5
    #

    Output

    2
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Java Python Rust