|All-time Popular Problems|
|Sort a stack|
|Delete Middle of Linked List|
|BFS traversal of graph|
|Largest subarray of 0's and 1's|
|Immediate Smaller Element|
|Delete nodes having greater value on right|
|Node at a given index in linked list|
|Two numbers with sum closest to zero|
|Print all nodes that don’t have sibling|
Given a number and check if a number is perfect or not. A number is said to be perfect if sum of all its factors excluding the number itself is equal to the number.
First line consists of T test cases. Then T test cases follow .Each test case consists of a number N.
Output in a single line 1 if a number is a perfect number else print 0.