Bird
Raised Fist0

Given the following partial output of subsets generated from an unknown input array: [[], [2], [3], [2, 3]] Which of the following could be the original input array?

hard🔄 Reverse Engineer Q9 of Q15
Bit Manipulation - Subsets Using Bitmask
Given the following partial output of subsets generated from an unknown input array: [[], [2], [3], [2, 3]] Which of the following could be the original input array?
A[3, 4]
B[1, 2]
C[2, 3]
D[1, 3]
Step-by-Step Solution
Solution:
  1. Step 1: Analyze subsets

    Subsets include empty, single elements 2 and 3, and their combination [2,3].
  2. Step 2: Match subsets to input

    Only input [2,3] produces exactly these subsets; others include 1 or 4 which are missing.
  3. Final Answer:

    Option C -> Option C
  4. Quick Check:

    Subsets match input elements 2 and 3 exactly [OK]
Quick Trick: Subsets must match all elements and combinations [OK]
Common Mistakes:
MISTAKES
  • Ignoring missing elements in subsets
  • Assuming subsets are incomplete
Trap Explanation:
PITFALL
  • Candidates may pick inputs with extra elements not reflected in subsets.
Interviewer Note:
CONTEXT
  • Tests candidate's ability to reason backwards from output to input.
Master "Subsets Using Bitmask" in Bit Manipulation

3 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bit Manipulation Quizzes