himanshu98 / Q1

solution of Q1 of backend assignment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Q1

solution of Q1 of backend assignment

  1. You are given an integer ​ N ​ denoting an ​ NxN​ matrix. Initially, each cell of the matrix is empty. You are given ​ K ​ tasks. In each task, you are given a cell ​ (i,j)​ where the cell ​ (i,j)​ represents the ​ i row and ​ j ​ column of the given matrix.You have to perform each task sequentially in the given order. Each task is described in a cell ​ (i,j)​ . For each task, you have to place ​ X ​ in each cell of row and each cell column . After you complete each task, you are required to print the number of empty cells in the matrix. Input format:
  2. The first line contains two space-separated integers N and K​ where ​ N ​ is the number of rows and columns in the given matrix and ​ K ​ is the number of tasks respectively.
  3. Next ​ K ​ lines contain two space-separated integers. Output format: Print ​ K ​ space-separated integers denoting the number of empty cells in the matrix.

About

solution of Q1 of backend assignment


Languages

Language:Python 100.0%