Yeah, I was thinking the same thing. Seems very similar to this problem: https://leetcode.com/problems/cracking-the-safe/
And can confirm that at least one FAANG company has asked this in a real interview.
And can confirm that at least one FAANG company has asked this in a real interview.
And if so - if someone solves this programming task on leetcode have they not then also solved the permutation problem from OP?