TCS - CodeVita - Coding Arena-D
TCS - CodeVita - Coding Arena-D
TCS - CodeVita - Coding Arena-D
Jaimanish Jayamurthy
Guidelines
When number of seeds in pod is even then median has to be calculated as the average of middle two numbers.
The Median should be considered up-to accuracy of 2 decimal places.
Thus 19-Pod-3 is the least-length, least-sigma, least-max-seed and least-median 19-Pod. Let us call such a pod a
Thus an Atomic N-Pod is a least-length, least-sigma, least-max-seed and least-median pod that consists of seed
Here's the problem: Accept number N and identify all Atomic N-pods.
Constraints
1 <= N <= 35
Input Format
First line contains Integer N.
Output
Atomic N-pods separated by OR arranged in ascending order if there are multiple such pods. Within a pod, arrange the seeds in ascending o
Explanation
Example 1: Input: 7
Output: {1,2,4}
https://www.tcscodevita.com/CodevitaV7/main_page.jsp 1/2
8/9/2018 TCS: CodeVita - Coding Arena
Example 2:
Input: 32
Output: {1,2,3,7,9,10}OR{1,2,4,6,9,10}
CodeVita FAQ's
CONNECT WITH US
CodeVita Blog
Privacy Policy
Careers
https://www.tcscodevita.com/CodevitaV7/main_page.jsp 2/2