Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write it using python A HOTEL with 1000 rooms has 1000 waiters. Each waiter and room is given a number from 1- 1000 Initially, waiter

image text in transcribed
Write it using python
A HOTEL with 1000 rooms has 1000 waiters. Each waiter and room is given a number from 1- 1000 Initially, waiter with number 1 goes and closes doors of all rooms. After that waiter with number 2 goes and changes the state of doors corresponding to multiples of that 2. After that waiter number 3 goes and changes the state of doors corresponding to multiples of 3 So on and so forth Find the number of doors that are open after the 1000th waiter has returned. NOTE: Changes the state of door means that opened doors are closed and closed doors ae opened

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions