Question: Computer lab In the computer lab, there are N tables numbered 0 to N-1. In each of the tables, either a student is seated
Computer lab In the computer lab, there are N tables numbered 0 to N-1. In each of the tables, either a student is seated or it is empty. The students will use computers to work on their assignments. A student can use a computer if it is placed to its immediate left or to its immediate right. Find the minimum number of computers that need to be allotted to the lab to serve all students. Determine if it is impossible for all students to work on assignments. Notes The computers can only be placed in empty tables. . Two students can share one computer. If lab[i]="S", there is a student seated. If lab[i]="", it is empty. Function description Complete the function solution() provided in the editor. The function takes the following 2 parameters and returns the solution: N: Represents the number of tables lab: Represents the state of tables Input format Note: This is the input format that you must use to provide custom and Tect button)
Step by Step Solution
There are 3 Steps involved in it
def solution N lab c... View full answer
Get step-by-step solutions from verified subject matter experts
