For sum it up problem how can we remove the duplicate combinations

Please tell what changes do i need to do https://ideone.com/m5eoFN