4 ms·
Yeah, I was thinking the same thing. Seems very similar to this problem: https://leetcode.com/problems/cracking-the-safe/ https://leetcode.com/problems/crackin
by bootsz 8y ago
Yeah, I was thinking the same thing. Seems very similar to this problem: https://leetcode.com/problems/cracking-the-safe/ https://leetcode.com/problems/cracking-the-safe/
And can confirm that at least one FAANG company has asked this in a real interview.
- quenstionsasked 8y agoHaven't taken the time to read through this properly so forgive the question - but is this any different from the above problem? And if so - if someone solves this programming task on leetcode have they not then also solved the permutation problem from OP?
- deleted 8y ago[deleted]
- robinhouston 8y agoIt is different because a safe combination may contain the same digit more than once, so the intended solution is a de Bruijn sequence: https://en.wikipedia.org/wiki/De_Bruijn_sequence https://en.wikipedia.org/wiki/De_Bruijn_sequence