13,663,325 members
See more:
? Sample Input: 6 1 2 3 3 4 5 Sample Output: 6 1 2 3 3 and 4 5 1 3 5 and 2 3 4 1 3 5 and 2 3 4 2 3 4 and 1 3 5 2 3 4 and 1 3 5 4 5 and 1 2 3 3

What I have tried:

I tried iterative but getting one ans only
Posted 14-Jun-18 9:54am
Updated 14-Jun-18 13:59pm

## Solution 1

Quote:
I tried iterative but getting one ans only

Show your code and we will help fixing it.
-----
So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

Top Experts
Last 24hrsThis month
 OriginalGriff 280 F-ES Sitecore 145 Gerry Schmitz 105 ppolymorphe 65 Vincent Maverick Durano 65
 OriginalGriff 3,437 Richard MacCutchan 1,367 ppolymorphe 1,277 Jochen Arndt 1,212 Dave Kreskowiak 763