Write code to calculate the number of people in a room at the end of the day, given that X people enter and Y people leave continuously throughout the day.
Code to calculate the number of people in a room at EOD given X people enter and Y people leave throughout the day.
Use a variable to keep track of the number of people in the room at any given time.
In...read more
Code to calculate number of people in a room at EOD given X enter and Y leave throughout the day.
Create a variable to keep track of the current number of people in the room
Increment the variable by X ...read more
def calculate_people_at_eod(people_enter, people_leave):
current_people_count = 0
# Assuming the length of people_enter and people_leave lists are the same
for i in range(len(people_enter)):
current_p...read more
Create a variable to keep track of the current number of people in the room
Increment the variable by X every time someone enters the room
Decrement the variable by Y every time someone leaves the room
R...read more
Deloitte Data Analyst interview questions & answers
Popular interview questions of Data Analyst
Top HR questions asked in Deloitte Data Analyst
Reviews
Interviews
Salaries
Users/Month