Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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’.

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’.