Splitting a deck in the dark
You are in a completely dark room with a deck of 52 cards. You are told that exactly 10 of them are face up and the rest face down, in unknown positions. You cannot see or feel which cards are face up.
Divide the deck into two piles so that each pile contains the same number of face-up cards. The piles need not be the same size, and you may turn cards over.
Show a hint
Take some number of cards off the top to form a pile. Whatever number of face-up cards it contains, the other pile contains 10 minus that many. What happens if you flip every card in your pile?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.