We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Problem: [1 ,2, 2, 3, 1, 2]
Incorrect:
Subsets [1,2,2,3] and [1,2]
My output: 4
Expected output: 5
Correct: because 3 doesn't fullfil condition to be in the same set as number 1
sorted: [1,1,2, 2, 2,3] Subsets [1,1,2,2,2] and [3] My output: 5 Expected output: 5
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Picking Numbers
You are viewing a single comment's thread. Return to all comments →
Problem: [1 ,2, 2, 3, 1, 2] Incorrect: Subsets [1,2,2,3] and [1,2] My output: 4 Expected output: 5
Correct: because 3 doesn't fullfil condition to be in the same set as number 1 sorted: [1,1,2, 2, 2,3] Subsets [1,1,2,2,2] and [3] My output: 5 Expected output: 5