Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soheshdoshi/-check-if-the-door-is-open-or-closed
Given n doors and n persons. The doors are numbered from 1 to n and persons are given id’s numbered from 1 to n. Each door can have only two statuses ie open (1) or closed (0) . Initially all the doors have status closed. Find the final status of all the doors, when all the persons have changed the status of the doors of which they are authorized. i.e. if status open then change the status to closed and vice versa. A person with id ‘i’ is authorized to change the status of door numbered ‘j’ if ‘j’ is a multiple of ‘i’.
https://github.com/soheshdoshi/-check-if-the-door-is-open-or-closed
Last synced: about 2 months ago
JSON representation
Given n doors and n persons. The doors are numbered from 1 to n and persons are given id’s numbered from 1 to n. Each door can have only two statuses ie open (1) or closed (0) . Initially all the doors have status closed. Find the final status of all the doors, when all the persons have changed the status of the doors of which they are authorized. i.e. if status open then change the status to closed and vice versa. A person with id ‘i’ is authorized to change the status of door numbered ‘j’ if ‘j’ is a multiple of ‘i’.
- Host: GitHub
- URL: https://github.com/soheshdoshi/-check-if-the-door-is-open-or-closed
- Owner: soheshdoshi
- Created: 2017-06-17T14:09:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-17T14:11:59.000Z (over 7 years ago)
- Last Synced: 2023-12-11T08:12:27.213Z (about 1 year ago)
- Language: C
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# -Check-if-the-door-is-open-or-closed
Given n doors and n persons. The doors are numbered from 1 to n and persons are given id’s numbered from 1 to n. Each door can have only two statuses ie open (1) or closed (0) . Initially all the doors have status closed. Find the final status of all the doors, when all the persons have changed the status of the doors of which they are authorized. i.e. if status open then change the status to closed and vice versa. A person with id ‘i’ is authorized to change the status of door numbered ‘j’ if ‘j’ is a multiple of ‘i’.