Code Working But 2 combinations are repeating

My code is giving outputs but 2 combinations are repeating in the sample test case. I am not able to understand how. My code : https://ide.codingblocks.com/s/148532

Whenever you find a combination just put that combination in a set, you will not get duplicates.