Tag Archives: prime-factor

Check if the door is open or closed

Given n doors and n persons. The doors are numbered 1 to n and persons are given id’s numbered 1 to n. Each door can have only 2 status open and closed. Initially all the doors have status closed. Find the final status of all the doors if a person changes the current status of… Read More »

Find politeness of a number

Given an integer n. Find politeness of number n. Politeness of a number is defined as the number of ways it can be expressed as the sum of consecutive integers. Input: n = 15 Output: 3 Explanation: There are only three ways to express 15 as sum of consecutive integers i.e., 15 = 1 +… Read More »