[Question]
  [
My PIN number is [1077](https://www.youtube.com/watch?v=Bq2F4aFOoYc), but that's too difficult to remember. I know from muscle memory that it's a digit, followed by a different digit, then followed by two of the same digit, which is different to the other two digits before it. As a pattern, we can say it is `ABCC` (where each letter represents a digit, and the same letter represents the same digit).
There are 15 possible PIN patterns. They are, along with some examples:
```
AAAA -> 5555    AAAB -> 7773    AABA -> 4484    AABB -> 3377    AABC -> 2265
ABAA -> 0300    ABAB -> 5252    ABAC -> 2325    ABBA -> 7667    ABBB -> 4888
ABBC -> 4880    ABCA -> 1041    ABCB -> 7080    ABCC -> 2600    ABCD -> 0857
```
You are to take 4 values as input representing the pattern of my PIN number. These values can be any reasonable value, such as the integers `1`, `2`, `3`, `4`, the letters `A`, `B`, `C`, `D` as strings, etc. You may choose what these values are, but please be mindful of [this](https://codegolf.meta.stackexchange.com/a/14110/66833) standard loophole when choosing values that aren't as simple as digits or characters.
You should then output all possible 4 digit combinations that fit the input pattern. You may output in any order, and in any format that clearly shows the 4 digits of each (so as integers doesn't work as you'll exclude leading zeros), and that clearly shows each combination together. One example could be outputting each digit separated by newlines and each combination separated by 3 newlines, or outputting a list of lists.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins.
## Test cases
There is a fixed set of inputs, so we can have a comprehensive set of test cases. However, the output for `ABCD` has 5040 numbers, which is rather long. [This](https://tio.run/##bVHbboQgFHyGr@ANSF1TcZ@a2KSXvzA@0Iq7tCwSxCa26bdbLko3TdWQkzMzZ0aOWdx51PW69mJAir8IRbi1fKF3EHxwNQvUoAqC13HWbvL11zcEw2iRUOIitENSo8j3dCCH3NZjhJKsfBfLRMJEsA1qN17nJ0aXACW7m@AHgRVuthq1f/n/eXcQGu6csDokbNuqiG9XbBXbKpZ77KpXx4plBcuKUO0oyyjL6K@2zmid0foKPXY@Y4i@5QzR98j@WsbZmdmF7F26XRkIluuTINWtf@Ld9fIk4w6UnBy5cEOkdgWanCWSlp@DVIocKaVpE2mXSUNR0@x@cQvJsOTGCN0TjMu3Ueo40k8r0KbyoyAw1rtkCn54fHrGrTxUaRXy6k9ogfDhHvvTf4mefChd1x8) program generates the complete I/O set. Below are just the first 25 (all 10 for `AAAA`), in lexicographic order:
```
AAAA -> 0000, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999
AAAB -> 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 1110, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 2220, 2221, 2223, 2224, 2225, 2226, 2227
AABA -> 0010, 0020, 0030, 0040, 0050, 0060, 0070, 0080, 0090, 1101, 1121, 1131, 1141, 1151, 1161, 1171, 1181, 1191, 2202, 2212, 2232, 2242, 2252, 2262, 2272
AABB -> 0011, 0022, 0033, 0044, 0055, 0066, 0077, 0088, 0099, 1100, 1122, 1133, 1144, 1155, 1166, 1177, 1188, 1199, 2200, 2211, 2233, 2244, 2255, 2266, 2277
AABC -> 0012, 0013, 0014, 0015, 0016, 0017, 0018, 0019, 0021, 0023, 0024, 0025, 0026, 0027, 0028, 0029, 0031, 0032, 0034, 0035, 0036, 0037, 0038, 0039, 0041
ABAA -> 0100, 0200, 0300, 0400, 0500, 0600, 0700, 0800, 0900, 1011, 1211, 1311, 1411, 1511, 1611, 1711, 1811, 1911, 2022, 2122, 2322, 2422, 2522, 2622, 2722
ABAB -> 0101, 0202, 0303, 0404, 0505, 0606, 0707, 0808, 0909, 1010, 1212, 1313, 1414, 1515, 1616, 1717, 1818, 1919, 2020, 2121, 2323, 2424, 2525, 2626, 2727
ABAC -> 0102, 0103, 0104, 0105, 0106, 0107, 0108, 0109, 0201, 0203, 0204, 0205, 0206, 0207, 0208, 0209, 0301, 0302, 0304, 0305, 0306, 0307, 0308, 0309, 0401
ABBA -> 0110, 0220, 0330, 0440, 0550, 0660, 0770, 0880, 0990, 1001, 1221, 1331, 1441, 1551, 1661, 1771, 1881, 1991, 2002, 2112, 2332, 2442, 2552, 2662, 2772
ABBB -> 0111, 0222, 0333, 0444, 0555, 0666, 0777, 0888, 0999, 1000, 1222, 1333, 1444, 1555, 1666, 1777, 1888, 1999, 2000, 2111, 2333, 2444, 2555, 2666, 2777
ABBC -> 0112, 0113, 0114, 0115, 0116, 0117, 0118, 0119, 0221, 0223, 0224, 0225, 0226, 0227, 0228, 0229, 0331, 0332, 0334, 0335, 0336, 0337, 0338, 0339, 0441
ABCA -> 0120, 0130, 0140, 0150, 0160, 0170, 0180, 0190, 0210, 0230, 0240, 0250, 0260, 0270, 0280, 0290, 0310, 0320, 0340, 0350, 0360, 0370, 0380, 0390, 0410
ABCB -> 0121, 0131, 0141, 0151, 0161, 0171, 0181, 0191, 0212, 0232, 0242, 0252, 0262, 0272, 0282, 0292, 0313, 0323, 0343, 0353, 0363, 0373, 0383, 0393, 0414
ABCC -> 0122, 0133, 0144, 0155, 0166, 0177, 0188, 0199, 0211, 0233, 0244, 0255, 0266, 0277, 0288, 0299, 0311, 0322, 0344, 0355, 0366, 0377, 0388, 0399, 0411
ABCD -> 0123, 0124, 0125, 0126, 0127, 0128, 0129, 0132, 0134, 0135, 0136, 0137, 0138, 0139, 0142, 0143, 0145, 0146, 0147, 0148, 0149, 0152, 0153, 0154, 0156
```
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
⁵Œ!’³ịⱮQ
```
Times out on TIO, takes about two minutes on my machine:
```
% time python3 -m jelly eu '⁵Œ!’³ịⱮQ' "[1,2,3,1]"
[[0, 1, 2, 0], [0, 1, 3, 0], [0, 1, 4, 0], [0, 1, 5, 0], [0, 1, 6, 0], [0, 1, 7, 0], [0, 1, 8, 0], [0, 1, 9, 0], [0, 2, 1, 0], [0, 2, 3, 0], [0, 2, 4, 0], [0, 2, 5, 0], [0, 2, 6, 0], [0, 2, 7, 0], [0, 2, 8, 0], [0, 2, 9, 0], [0, 3, 1, 0], [0, 3, 2, 0], [0, 3, 4, 0], [0, 3, 5, 0], [0, 3, 6, 0], [0, 3, 7, 0], [0, 3, 8, 0], [0, 3, 9, 0], [0, 4, 1, 0], [0, 4, 2, 0], [0, 4, 3, 0], [0, 4, 5, 0], [0, 4, 6, 0], [0, 4, 7, 0], [0, 4, 8, 0], [0, 4, 9, 0], [0, 5, 1, 0], [0, 5, 2, 0], [0, 5, 3, 0], [0, 5, 4, 0], [0, 5, 6, 0], [0, 5, 7, 0], [0, 5, 8, 0], [0, 5, 9, 0], [0, 6, 1, 0], [0, 6, 2, 0], [0, 6, 3, 0], [0, 6, 4, 0], [0, 6, 5, 0], [0, 6, 7, 0], [0, 6, 8, 0], [0, 6, 9, 0], [0, 7, 1, 0], [0, 7, 2, 0], [0, 7, 3, 0], [0, 7, 4, 0], [0, 7, 5, 0], [0, 7, 6, 0], [0, 7, 8, 0], [0, 7, 9, 0], [0, 8, 1, 0], [0, 8, 2, 0], [0, 8, 3, 0], [0, 8, 4, 0], [0, 8, 5, 0], [0, 8, 6, 0], [0, 8, 7, 0], [0, 8, 9, 0], [0, 9, 1, 0], [0, 9, 2, 0], [0, 9, 3, 0], [0, 9, 4, 0], [0, 9, 5, 0], [0, 9, 6, 0], [0, 9, 7, 0], [0, 9, 8, 0], [1, 0, 2, 1], [1, 0, 3, 1], [1, 0, 4, 1], [1, 0, 5, 1], [1, 0, 6, 1], [1, 0, 7, 1], [1, 0, 8, 1], [1, 0, 9, 1], [1, 2, 0, 1], [1, 2, 3, 1], [1, 2, 4, 1], [1, 2, 5, 1], [1, 2, 6, 1], [1, 2, 7, 1], [1, 2, 8, 1], [1, 2, 9, 1], [1, 3, 0, 1], [1, 3, 2, 1], [1, 3, 4, 1], [1, 3, 5, 1], [1, 3, 6, 1], [1, 3, 7, 1], [1, 3, 8, 1], [1, 3, 9, 1], [1, 4, 0, 1], [1, 4, 2, 1], [1, 4, 3, 1], [1, 4, 5, 1], [1, 4, 6, 1], [1, 4, 7, 1], [1, 4, 8, 1], [1, 4, 9, 1], [1, 5, 0, 1], [1, 5, 2, 1], [1, 5, 3, 1], [1, 5, 4, 1], [1, 5, 6, 1], [1, 5, 7, 1], [1, 5, 8, 1], [1, 5, 9, 1], [1, 6, 0, 1], [1, 6, 2, 1], [1, 6, 3, 1], [1, 6, 4, 1], [1, 6, 5, 1], [1, 6, 7, 1], [1, 6, 8, 1], [1, 6, 9, 1], [1, 7, 0, 1], [1, 7, 2, 1], [1, 7, 3, 1], [1, 7, 4, 1], [1, 7, 5, 1], [1, 7, 6, 1], [1, 7, 8, 1], [1, 7, 9, 1], [1, 8, 0, 1], [1, 8, 2, 1], [1, 8, 3, 1], [1, 8, 4, 1], [1, 8, 5, 1], [1, 8, 6, 1], [1, 8, 7, 1], [1, 8, 9, 1], [1, 9, 0, 1], [1, 9, 2, 1], [1, 9, 3, 1], [1, 9, 4, 1], [1, 9, 5, 1], [1, 9, 6, 1], [1, 9, 7, 1], [1, 9, 8, 1], [2, 0, 1, 2], [2, 0, 3, 2], [2, 0, 4, 2], [2, 0, 5, 2], [2, 0, 6, 2], [2, 0, 7, 2], [2, 0, 8, 2], [2, 0, 9, 2], [2, 1, 0, 2], [2, 1, 3, 2], [2, 1, 4, 2], [2, 1, 5, 2], [2, 1, 6, 2], [2, 1, 7, 2], [2, 1, 8, 2], [2, 1, 9, 2], [2, 3, 0, 2], [2, 3, 1, 2], [2, 3, 4, 2], [2, 3, 5, 2], [2, 3, 6, 2], [2, 3, 7, 2], [2, 3, 8, 2], [2, 3, 9, 2], [2, 4, 0, 2], [2, 4, 1, 2], [2, 4, 3, 2], [2, 4, 5, 2], [2, 4, 6, 2], [2, 4, 7, 2], [2, 4, 8, 2], [2, 4, 9, 2], [2, 5, 0, 2], [2, 5, 1, 2], [2, 5, 3, 2], [2, 5, 4, 2], [2, 5, 6, 2], [2, 5, 7, 2], [2, 5, 8, 2], [2, 5, 9, 2], [2, 6, 0, 2], [2, 6, 1, 2], [2, 6, 3, 2], [2, 6, 4, 2], [2, 6, 5, 2], [2, 6, 7, 2], [2, 6, 8, 2], [2, 6, 9, 2], [2, 7, 0, 2], [2, 7, 1, 2], [2, 7, 3, 2], [2, 7, 4, 2], [2, 7, 5, 2], [2, 7, 6, 2], [2, 7, 8, 2], [2, 7, 9, 2], [2, 8, 0, 2], [2, 8, 1, 2], [2, 8, 3, 2], [2, 8, 4, 2], [2, 8, 5, 2], [2, 8, 6, 2], [2, 8, 7, 2], [2, 8, 9, 2], [2, 9, 0, 2], [2, 9, 1, 2], [2, 9, 3, 2], [2, 9, 4, 2], [2, 9, 5, 2], [2, 9, 6, 2], [2, 9, 7, 2], [2, 9, 8, 2], [3, 0, 1, 3], [3, 0, 2, 3], [3, 0, 4, 3], [3, 0, 5, 3], [3, 0, 6, 3], [3, 0, 7, 3], [3, 0, 8, 3], [3, 0, 9, 3], [3, 1, 0, 3], [3, 1, 2, 3], [3, 1, 4, 3], [3, 1, 5, 3], [3, 1, 6, 3], [3, 1, 7, 3], [3, 1, 8, 3], [3, 1, 9, 3], [3, 2, 0, 3], [3, 2, 1, 3], [3, 2, 4, 3], [3, 2, 5, 3], [3, 2, 6, 3], [3, 2, 7, 3], [3, 2, 8, 3], [3, 2, 9, 3], [3, 4, 0, 3], [3, 4, 1, 3], [3, 4, 2, 3], [3, 4, 5, 3], [3, 4, 6, 3], [3, 4, 7, 3], [3, 4, 8, 3], [3, 4, 9, 3], [3, 5, 0, 3], [3, 5, 1, 3], [3, 5, 2, 3], [3, 5, 4, 3], [3, 5, 6, 3], [3, 5, 7, 3], [3, 5, 8, 3], [3, 5, 9, 3], [3, 6, 0, 3], [3, 6, 1, 3], [3, 6, 2, 3], [3, 6, 4, 3], [3, 6, 5, 3], [3, 6, 7, 3], [3, 6, 8, 3], [3, 6, 9, 3], [3, 7, 0, 3], [3, 7, 1, 3], [3, 7, 2, 3], [3, 7, 4, 3], [3, 7, 5, 3], [3, 7, 6, 3], [3, 7, 8, 3], [3, 7, 9, 3], [3, 8, 0, 3], [3, 8, 1, 3], [3, 8, 2, 3], [3, 8, 4, 3], [3, 8, 5, 3], [3, 8, 6, 3], [3, 8, 7, 3], [3, 8, 9, 3], [3, 9, 0, 3], [3, 9, 1, 3], [3, 9, 2, 3], [3, 9, 4, 3], [3, 9, 5, 3], [3, 9, 6, 3], [3, 9, 7, 3], [3, 9, 8, 3], [4, 0, 1, 4], [4, 0, 2, 4], [4, 0, 3, 4], [4, 0, 5, 4], [4, 0, 6, 4], [4, 0, 7, 4], [4, 0, 8, 4], [4, 0, 9, 4], [4, 1, 0, 4], [4, 1, 2, 4], [4, 1, 3, 4], [4, 1, 5, 4], [4, 1, 6, 4], [4, 1, 7, 4], [4, 1, 8, 4], [4, 1, 9, 4], [4, 2, 0, 4], [4, 2, 1, 4], [4, 2, 3, 4], [4, 2, 5, 4], [4, 2, 6, 4], [4, 2, 7, 4], [4, 2, 8, 4], [4, 2, 9, 4], [4, 3, 0, 4], [4, 3, 1, 4], [4, 3, 2, 4], [4, 3, 5, 4], [4, 3, 6, 4], [4, 3, 7, 4], [4, 3, 8, 4], [4, 3, 9, 4], [4, 5, 0, 4], [4, 5, 1, 4], [4, 5, 2, 4], [4, 5, 3, 4], [4, 5, 6, 4], [4, 5, 7, 4], [4, 5, 8, 4], [4, 5, 9, 4], [4, 6, 0, 4], [4, 6, 1, 4], [4, 6, 2, 4], [4, 6, 3, 4], [4, 6, 5, 4], [4, 6, 7, 4], [4, 6, 8, 4], [4, 6, 9, 4], [4, 7, 0, 4], [4, 7, 1, 4], [4, 7, 2, 4], [4, 7, 3, 4], [4, 7, 5, 4], [4, 7, 6, 4], [4, 7, 8, 4], [4, 7, 9, 4], [4, 8, 0, 4], [4, 8, 1, 4], [4, 8, 2, 4], [4, 8, 3, 4], [4, 8, 5, 4], [4, 8, 6, 4], [4, 8, 7, 4], [4, 8, 9, 4], [4, 9, 0, 4], [4, 9, 1, 4], [4, 9, 2, 4], [4, 9, 3, 4], [4, 9, 5, 4], [4, 9, 6, 4], [4, 9, 7, 4], [4, 9, 8, 4], [5, 0, 1, 5], [5, 0, 2, 5], [5, 0, 3, 5], [5, 0, 4, 5], [5, 0, 6, 5], [5, 0, 7, 5], [5, 0, 8, 5], [5, 0, 9, 5], [5, 1, 0, 5], [5, 1, 2, 5], [5, 1, 3, 5], [5, 1, 4, 5], [5, 1, 6, 5], [5, 1, 7, 5], [5, 1, 8, 5], [5, 1, 9, 5], [5, 2, 0, 5], [5, 2, 1, 5], [5, 2, 3, 5], [5, 2, 4, 5], [5, 2, 6, 5], [5, 2, 7, 5], [5, 2, 8, 5], [5, 2, 9, 5], [5, 3, 0, 5], [5, 3, 1, 5], [5, 3, 2, 5], [5, 3, 4, 5], [5, 3, 6, 5], [5, 3, 7, 5], [5, 3, 8, 5], [5, 3, 9, 5], [5, 4, 0, 5], [5, 4, 1, 5], [5, 4, 2, 5], [5, 4, 3, 5], [5, 4, 6, 5], [5, 4, 7, 5], [5, 4, 8, 5], [5, 4, 9, 5], [5, 6, 0, 5], [5, 6, 1, 5], [5, 6, 2, 5], [5, 6, 3, 5], [5, 6, 4, 5], [5, 6, 7, 5], [5, 6, 8, 5], [5, 6, 9, 5], [5, 7, 0, 5], [5, 7, 1, 5], [5, 7, 2, 5], [5, 7, 3, 5], [5, 7, 4, 5], [5, 7, 6, 5], [5, 7, 8, 5], [5, 7, 9, 5], [5, 8, 0, 5], [5, 8, 1, 5], [5, 8, 2, 5], [5, 8, 3, 5], [5, 8, 4, 5], [5, 8, 6, 5], [5, 8, 7, 5], [5, 8, 9, 5], [5, 9, 0, 5], [5, 9, 1, 5], [5, 9, 2, 5], [5, 9, 3, 5], [5, 9, 4, 5], [5, 9, 6, 5], [5, 9, 7, 5], [5, 9, 8, 5], [6, 0, 1, 6], [6, 0, 2, 6], [6, 0, 3, 6], [6, 0, 4, 6], [6, 0, 5, 6], [6, 0, 7, 6], [6, 0, 8, 6], [6, 0, 9, 6], [6, 1, 0, 6], [6, 1, 2, 6], [6, 1, 3, 6], [6, 1, 4, 6], [6, 1, 5, 6], [6, 1, 7, 6], [6, 1, 8, 6], [6, 1, 9, 6], [6, 2, 0, 6], [6, 2, 1, 6], [6, 2, 3, 6], [6, 2, 4, 6], [6, 2, 5, 6], [6, 2, 7, 6], [6, 2, 8, 6], [6, 2, 9, 6], [6, 3, 0, 6], [6, 3, 1, 6], [6, 3, 2, 6], [6, 3, 4, 6], [6, 3, 5, 6], [6, 3, 7, 6], [6, 3, 8, 6], [6, 3, 9, 6], [6, 4, 0, 6], [6, 4, 1, 6], [6, 4, 2, 6], [6, 4, 3, 6], [6, 4, 5, 6], [6, 4, 7, 6], [6, 4, 8, 6], [6, 4, 9, 6], [6, 5, 0, 6], [6, 5, 1, 6], [6, 5, 2, 6], [6, 5, 3, 6], [6, 5, 4, 6], [6, 5, 7, 6], [6, 5, 8, 6], [6, 5, 9, 6], [6, 7, 0, 6], [6, 7, 1, 6], [6, 7, 2, 6], [6, 7, 3, 6], [6, 7, 4, 6], [6, 7, 5, 6], [6, 7, 8, 6], [6, 7, 9, 6], [6, 8, 0, 6], [6, 8, 1, 6], [6, 8, 2, 6], [6, 8, 3, 6], [6, 8, 4, 6], [6, 8, 5, 6], [6, 8, 7, 6], [6, 8, 9, 6], [6, 9, 0, 6], [6, 9, 1, 6], [6, 9, 2, 6], [6, 9, 3, 6], [6, 9, 4, 6], [6, 9, 5, 6], [6, 9, 7, 6], [6, 9, 8, 6], [7, 0, 1, 7], [7, 0, 2, 7], [7, 0, 3, 7], [7, 0, 4, 7], [7, 0, 5, 7], [7, 0, 6, 7], [7, 0, 8, 7], [7, 0, 9, 7], [7, 1, 0, 7], [7, 1, 2, 7], [7, 1, 3, 7], [7, 1, 4, 7], [7, 1, 5, 7], [7, 1, 6, 7], [7, 1, 8, 7], [7, 1, 9, 7], [7, 2, 0, 7], [7, 2, 1, 7], [7, 2, 3, 7], [7, 2, 4, 7], [7, 2, 5, 7], [7, 2, 6, 7], [7, 2, 8, 7], [7, 2, 9, 7], [7, 3, 0, 7], [7, 3, 1, 7], [7, 3, 2, 7], [7, 3, 4, 7], [7, 3, 5, 7], [7, 3, 6, 7], [7, 3, 8, 7], [7, 3, 9, 7], [7, 4, 0, 7], [7, 4, 1, 7], [7, 4, 2, 7], [7, 4, 3, 7], [7, 4, 5, 7], [7, 4, 6, 7], [7, 4, 8, 7], [7, 4, 9, 7], [7, 5, 0, 7], [7, 5, 1, 7], [7, 5, 2, 7], [7, 5, 3, 7], [7, 5, 4, 7], [7, 5, 6, 7], [7, 5, 8, 7], [7, 5, 9, 7], [7, 6, 0, 7], [7, 6, 1, 7], [7, 6, 2, 7], [7, 6, 3, 7], [7, 6, 4, 7], [7, 6, 5, 7], [7, 6, 8, 7], [7, 6, 9, 7], [7, 8, 0, 7], [7, 8, 1, 7], [7, 8, 2, 7], [7, 8, 3, 7], [7, 8, 4, 7], [7, 8, 5, 7], [7, 8, 6, 7], [7, 8, 9, 7], [7, 9, 0, 7], [7, 9, 1, 7], [7, 9, 2, 7], [7, 9, 3, 7], [7, 9, 4, 7], [7, 9, 5, 7], [7, 9, 6, 7], [7, 9, 8, 7], [8, 0, 1, 8], [8, 0, 2, 8], [8, 0, 3, 8], [8, 0, 4, 8], [8, 0, 5, 8], [8, 0, 6, 8], [8, 0, 7, 8], [8, 0, 9, 8], [8, 1, 0, 8], [8, 1, 2, 8], [8, 1, 3, 8], [8, 1, 4, 8], [8, 1, 5, 8], [8, 1, 6, 8], [8, 1, 7, 8], [8, 1, 9, 8], [8, 2, 0, 8], [8, 2, 1, 8], [8, 2, 3, 8], [8, 2, 4, 8], [8, 2, 5, 8], [8, 2, 6, 8], [8, 2, 7, 8], [8, 2, 9, 8], [8, 3, 0, 8], [8, 3, 1, 8], [8, 3, 2, 8], [8, 3, 4, 8], [8, 3, 5, 8], [8, 3, 6, 8], [8, 3, 7, 8], [8, 3, 9, 8], [8, 4, 0, 8], [8, 4, 1, 8], [8, 4, 2, 8], [8, 4, 3, 8], [8, 4, 5, 8], [8, 4, 6, 8], [8, 4, 7, 8], [8, 4, 9, 8], [8, 5, 0, 8], [8, 5, 1, 8], [8, 5, 2, 8], [8, 5, 3, 8], [8, 5, 4, 8], [8, 5, 6, 8], [8, 5, 7, 8], [8, 5, 9, 8], [8, 6, 0, 8], [8, 6, 1, 8], [8, 6, 2, 8], [8, 6, 3, 8], [8, 6, 4, 8], [8, 6, 5, 8], [8, 6, 7, 8], [8, 6, 9, 8], [8, 7, 0, 8], [8, 7, 1, 8], [8, 7, 2, 8], [8, 7, 3, 8], [8, 7, 4, 8], [8, 7, 5, 8], [8, 7, 6, 8], [8, 7, 9, 8], [8, 9, 0, 8], [8, 9, 1, 8], [8, 9, 2, 8], [8, 9, 3, 8], [8, 9, 4, 8], [8, 9, 5, 8], [8, 9, 6, 8], [8, 9, 7, 8], [9, 0, 1, 9], [9, 0, 2, 9], [9, 0, 3, 9], [9, 0, 4, 9], [9, 0, 5, 9], [9, 0, 6, 9], [9, 0, 7, 9], [9, 0, 8, 9], [9, 1, 0, 9], [9, 1, 2, 9], [9, 1, 3, 9], [9, 1, 4, 9], [9, 1, 5, 9], [9, 1, 6, 9], [9, 1, 7, 9], [9, 1, 8, 9], [9, 2, 0, 9], [9, 2, 1, 9], [9, 2, 3, 9], [9, 2, 4, 9], [9, 2, 5, 9], [9, 2, 6, 9], [9, 2, 7, 9], [9, 2, 8, 9], [9, 3, 0, 9], [9, 3, 1, 9], [9, 3, 2, 9], [9, 3, 4, 9], [9, 3, 5, 9], [9, 3, 6, 9], [9, 3, 7, 9], [9, 3, 8, 9], [9, 4, 0, 9], [9, 4, 1, 9], [9, 4, 2, 9], [9, 4, 3, 9], [9, 4, 5, 9], [9, 4, 6, 9], [9, 4, 7, 9], [9, 4, 8, 9], [9, 5, 0, 9], [9, 5, 1, 9], [9, 5, 2, 9], [9, 5, 3, 9], [9, 5, 4, 9], [9, 5, 6, 9], [9, 5, 7, 9], [9, 5, 8, 9], [9, 6, 0, 9], [9, 6, 1, 9], [9, 6, 2, 9], [9, 6, 3, 9], [9, 6, 4, 9], [9, 6, 5, 9], [9, 6, 7, 9], [9, 6, 8, 9], [9, 7, 0, 9], [9, 7, 1, 9], [9, 7, 2, 9], [9, 7, 3, 9], [9, 7, 4, 9], [9, 7, 5, 9], [9, 7, 6, 9], [9, 7, 8, 9], [9, 8, 0, 9], [9, 8, 1, 9], [9, 8, 2, 9], [9, 8, 3, 9], [9, 8, 4, 9], [9, 8, 5, 9], [9, 8, 6, 9], [9, 8, 7, 9]]
108.00s user 0.90s system 99% cpu 1:49.73 total
```
Accepts a pattern in the format `[1,2,2,3]`.
```
⁵Œ!’        All permutations of [0..9].
     ³ịⱮ    For each such permutation, use the input as index vector:
              e.g. for input [1,2,2,3], turn 3862149075 into 3886.
        Q   Eliminate duplicates.
```
[Answer]
# [Factor](https://factorcode.org/) + `math.combinatorics`, 50 bytes
```
[ 10 iota [ nths ] with map-permutations members ]
```
[Try it online!](https://tio.run/##DYwxDsIwEAT7vGI/QOS08ABEQ4OoIgrHOuQT8dn4LooQ4u3GxVQzmqcPlmu73y7X8xFK740kkOJFVWhF8hbHkNPC4nvHQXtjilLJ7FMqi@E0DF84TB2HX5sxOXA2jxliUfHAzhb7qhwK1bSZN86iSJQWqt234NcVY/sD "Factor – Try It Online")
Port of @Lynn's [Jelly answer](https://codegolf.stackexchange.com/a/233057/97916).
* `10 iota` The digits from 0 to 9.
* `[ ... ] with` Include the input in a quotation.
* `[ nths ] map-permutations` Map the permutations of 0-9 to the indices given by the input.
* `members` Remove duplicates.
[Answer]
# [Python 3](https://docs.python.org/3/), 86 bytes
```
lambda*r:{eval('x[%d],'*4%r)for x in permutations(range(10),5)}
from itertools import*
```
[Try it online!](https://tio.run/##HYxBCoMwEADvfUUQxCTkUGt7EXyJekgxaQNmN2zWYil9eyqdOc1l0pufCF3xw1RWG@@L1dR/3MuustnHeplNo681KY8kdhFAJEdxY8sBIUuy8HCyPStzU9@TJ4wisCNGXLMIMSGxLokCsNT5CLdIL/X/HiBtLNWByS4N1QSVKmNrLofd/AM "Python 3 – Try It Online")
Fix and -3 thanks to @dingledooper
-2 thanks to @tsh
(`f()` outputs unsorted list, so footer code is added to display sorted and joined by newlines)
Very fast. Fixed time complexity of \$O(120960) = O(10P5×4)\$, it could be \$6×\$ faster if we could take input numbers decremented by 1.
[Answer]
# [J](http://jsoftware.com/), 27 24 23 bytes
```
(-:&="1#])&(>,{4$<i.10)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/NXSt1GyVDJVjNdU07HSqTVRsMvUMDTT/a3KlJmfkK6QpqDsCgTqEp66rq6uOJOHkhEPC0Un9PwA "J – Try It Online")
* `(>,{4$<i.10)` Generates all 10K pins.
* `-:&="1#]` Filter those by equality to the input after transforming both by ["Self Classify"](https://code.jsoftware.com/wiki/Vocabulary/eq#monadic) `=`. Self classify gives a boolean signature for each unique member of a list, thereby encoding the "mask" that we're trying to match. Eg, `= 'AABC'` returns:
```
1 1 0 0
0 0 1 0
0 0 0 1 
```
### bonus
`[:~.]{"1(i.@!A.i.)@10` for [21 bytes](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o63q9GKrlQw1MvUcFB31MvU0HQwN/mtypSZn5CukARWCIYSrrqurq44sY6hgiEMGKPcfAA) using [Lynn's clever approach](https://codegolf.stackexchange.com/a/233057/15469). Executes decently fast.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
9ʀṖƛ?İ;U
```
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=9%CA%80%E1%B9%96%C6%9B%3F%C4%B0%3BU&inputs=%5B1%2C2%2C2%2C3%5D&header=&footer=)
Will time out. (But work in theory, because taking 0..n (n<9) permutations finish properly in time)
```
9ʀṖ                     # 0..9 permutations
       ƛ                  # For each
             ?İ          #  Index with input
                ;U      # Close and remove duplicates
```
[Answer]
# [R](https://www.r-project.org/) >= 4.1 plus gtools, 41 bytes
```
\(x)gtools::permutations(10,max(x))[,x]-1
```
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP0@jQjO9JD8/p9jKqiC1KLe0JBEkWqxhaKCTm1gBlNWM1qmI1TX8n6aRrGGoY6RjrGOsqfkfAA "R – Try It Online")
A function that takes a vector of integers and returns a matrix with the PINs in rows and the digits in columns. It would be nice to have a base R equivalent of `combn` for permutations.
Thanks to @Mark for pointing out the flaw in my previous answer which did permutations with replacement rather than without.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
Ġ⁵ṗ4¤ĠṢ⁼ɗƇ’
```
[Try it online!](https://tio.run/##y0rNyan8///IgkeNWx/unG5yaMmRBQ93LnrUuOfk9GPtjxpm/v//P9pQxwgIDWMB "Jelly – Try It Online")
Works equally well when given a list of digits (`[1, 2, 3, 4]`) or a string (`"ABCD"`).
### How it works
```
Ġ⁵ṗ4¤ĠṢ⁼ɗƇ’    Monadic link. Left arg: PIN pattern
Ġ              Group indices by identical values
               (which gives the pattern to filter the combinations for)
 ⁵ṗ4¤ĠṢ⁼ɗƇ     Monad-dyad pair:
 ⁵ṗ4¤          Create a list of 4-digit combinations using 1-10
         Ƈ     Filter from the above list by:
     ĠṢ⁼ɗ        Is the list of sorted groups identical to the input's?
          ’    Decrement to get a list of 0-9 combinations
```
[Answer]
# [Jelly (fork)](https://github.com/cairdcoinheringaahing/jellylanguage), 8 bytes
```
9Żṗ4Qi$Ƙ
```
[Try it online!](https://tio.run/##AScA2P9qZWxsef//OcW74bmXNFFp4rGuJOKBvMKlxof///9bMSwyLDMsMV0 "Jelly – Try It Online") (my original Jelly answer)
Didn't take long for [Lynn to outgolf](https://codegolf.stackexchange.com/a/233057/66833) my [original Jelly answer](https://tio.run/##AScA2P9qZWxsef//OcW74bmXNFFp4rGuJOKBvMKlxof///9bMSwyLDMsMV0 "Jelly – Try It Online"), so I thought I'd show my approach, using my fork because `⁼¥Ƈ` annoys me.
## How it works
```
9Żṗ4Qi$Ƙ - Main link. Takes [a,b,c,d] on the left
9Ż       - Zero-range of 9; Yield [0,1,2,3,4,5,6,7,8,9]
  ṗ4     - Fourth cartesian power; All length-4 lists with elements from that range
      $Ƙ - Keep those elements [x,y,z,w] for which the following equals [a,b,c,d]:
    Q    -   Unique elements
     i   -   Their indices in [x,y,z,w]
```
In this case, `i` in my fork has been modified so that using it on flat lists is equivalent to `iⱮ`, as otherwise it outputs `0` (not found): [Try it online!](https://tio.run/##y0rNyan8/z/z////0YY6RjrGOoaxYFYsAA "Jelly – Try It Online") Additionally, `Ƙ` has been added to supplant `⁼¥Ƈ` as it gets used [a lot](https://github.com/DennisMitchell/jellylanguage/issues/91).
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
```
9Ýœε¹è}Ù
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f8vDco5PPbT208/CK2sMz//@PNtQxAkLjWAA "05AB1E – Try It Online")
-2 Thanks to @ovs
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Input is an array of integers `1-4`. Output is an array of integer arrays. Careful running this one; even with all 4 input integers the same, it takes about 10.5 seconds to complete.
```
Ao á mgU â
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QW8g4TQgbWdVIOI&input=WzEgMSAyIDJdCi1S) (Limits the lengths of the permutations to 4)
```
Ao á mgU â     :Implicit input of array U
A              :10
 o             :Range [0,A)
   á           :Permutations
     m         :Map
      gU       :  Get elements at 0-based indices in U
         â     :Deduplicate
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
Ṁ⁵œ!’ị@€
```
[Try it online!](https://tio.run/##ASQA2/9qZWxsef//4bmA4oG1xZMh4oCZ4buLQOKCrP///zEsMiwzLDM "Jelly – Try It Online")
Another Jelly 8-byter. This works similarly to my R answer, and completes quickly on TIO.
```
Ṁ        | Max
 ⁵œ!     | Permutations of (10, max(x))
    ’    | Decrease by 1
     ị@€ | Index original argument into each permutation
```
[Answer]
# Google Sheets, ~~366 354 352 301 203~~ 189
Ending parens discounted.
## Setup
* Input: A1, (any format)
* A2: Cache every relevant character comparison result
```
=ArrayFormula(MID(A1,{1;2;3},1)=MID(A1,{2,3,4},1))
```
* E1:
```
=SEQUENCE(1e4,1,)
```
* Set Column E to format all 4 digits. (Custom format `0000`. We'll add +4 for this)
* F1: Split digits into columns
```
=ArrayFormula(MID(E:E,{1,2,3,4},1))
```
* J1 (result):
```
=FILTER(E:E,(F:F=G:G=A2)*(F:F=H:H=B2)*(F:F=I:I=C2)*(G:G=H:H=B3)*(G:G=I:I=C3)*(H:H=I:I=C4))
```
## Notes
* At a high level, it enumerates all possible PINs with `SEQUENCE`, then applies several filter conditions to remove unwanted result.
* Each filter condition checks PINs that either both match or both don't match in the corresponding places (`=` is like `XNOR` in that regard)
* `*` acts like and `AND`
[Answer]
# [JavaScript (V8)](https://v8.dev/), 87 bytes
Expects a pattern made of non-digit characters. Prints the results.
```
f=(s,m=/\D/.exec(s),g=n=>n--&&g(n,s.match(n)||f(s.split(m).join(n))))=>m?g(10):print(s)
```
[Try it online!](https://tio.run/##TY/RCoMgFIbv9xRejFIo2@7GwkbWnqIFRZQrSqMTMaievUkz2Lnw5//8OGiTTzkUQ92P7nTbtophcDrmvWKPlp@ywEAcwSQLpOtalsDSAdrlY/HGkixLhYFC39Yj7ghtVC011cOC7iHw9ULu/VDLUe/Y/ATZoR7b2ZP/kpvOjx7tyY3HjcdDw43Pjc8PPzI8Mjw6eGyj9EQrNTxz/WRALEAzKpQE1Za0VQJnyXmGNc2Ij/Rn9Pl/qetKti8 "JavaScript (V8) – Try It Online")
---
# JavaScript (ES10), 100 bytes
Expects a pattern made of `1`, `2`, `3`, `4`. Returns an array of strings.
```
s=>[...Array(x=1e4)].flatMap(_=>(S=`${x++}`.slice(-4)).replace(o=/./g,c=>o[c]=o[c]||++n,n=0)^s?[]:S)
```
[Try it online!](https://tio.run/##NYoxT8MwEEZ3foWHSLaV9EqcTKALYmBk6pgaYrlOSWXZkV2hojS/PZTi3HCf3tM7qW8VdRjG88b5g1l6XCI2LQC8hqB@2AVLU3MJvVXndzWyT2zYDrtsuuT53EG0gzZsU3MOwYxW3cDjFrbHQmPjWy3x712vee4Kh4/8I7608mnHl@eW0PJ2tLiv@F@RWKxc3VekTqROlMmnXqRerH2VfJV8tfqaEvkAvQ9vSn@xSLAh2rvorQHrj6xrsynOcu@yqWeRw8kPjlFC@bx3HefLLw "JavaScript (Node.js) – Try It Online")
[Answer]
# JavaScript (browser), 83 bytes
```
p=>{for(i=1e5;i++<2e5;)/.(.).*\1/.test(i+=n='')?0:p[p.map(v=>n+=i[v])]??=+alert(n)}
```
```
f =
p=>{for(i=1e5;i++<2e5;)/.(.).*\1/.test(i+=n='')?0:p[p.map(v=>n+=i[v])]??=+alert(n)}
alert = s => output.textContent += s + '\n'
f([1,1,1,1])
alert('----')
f([1,1,1,2])
```
```
<output id=output style=white-space:pre></output>
```
Input an array of 4 numbers, each number in range 1 to 4, `f([1, 2, 3, 4])` for example.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 29 bytes
```
ＥΦＥＸχ⊕⌈θ⭆◧Ｉι⊕⌈θΣλ⬤ι⁼¹№ιλ⭆θ§ιλ
```
[Try it online!](https://tio.run/##fY49C8IwEIb/SsYLRLCuTlIUCgoFx9LhaKMGrkmTXrX/Pp4dBBfhhod7P3i7B6YuIOVcJ@cZLjjCyRHbtGIdXkLF1qjKd8kO1rPtRVncMA8QtdZGXVmS99WN/dneGEqcGJz@GxKilQ5E4Iw6xhlpgsKoMswyRF4f/ac/ipsr39vlK@9zbhqZJ7mdXNvmzZPe "Charcoal – Try It Online") Link is to verbose version of code. Takes input as a list of 0-indexed digits. Explanation:
```
    χ                           Predefined variable 10
   Ｘ                            Raised to power
       θ                        Input array
      ⌈                         Maximum
     ⊕                          Incremented
  Ｅ                             Map over implicit range
            ι                    Current value
           Ｉ                     Cast to string
          ◧                      Left padded to length
               θ                 Input array
              ⌈                  Maximum
             ⊕                   Incremented
         ⭆                       Map over characters and join
                 λ               Current character
                Σ                Numeric value or 0 for space
 Φ                               Filtered where
                   ι             Current string
                  ⬤              All digits satisfy
                      №          Count of
                        λ        Current digit
                       ι         In current string
                    ⁼            Is equal to
                     ¹           Literal `1`
Ｅ                                Map over strings
                          θ      Input array
                         ⭆       Map over values and join
                            ι    Current string
                           §     Indexed by
                             λ   Current value
                                 Implicitly print
```
[Answer]
# [PHP](https://www.php.net/), 128 bytes
```
for(;$n<1e4;){$s=sprintf('%04d',$n++);$m='';$l=A;$v=[];for($d=0;$d<4;)$m.=$v[$g=$s[$d++]]??$v[$g]=$l++;$m==$argn&&print($s.~_);}
```
[Try it online!](https://tio.run/##HYxBCoMwFAUv82oiacWCu@9HdNFLSCiFVCtoDIm4Ke3Rm6qbWQzMuJeLZeU2drOXBFtenwWlbwQOzg926aQ45YURZ1ilUsLEQhBGrgkrt5r2DIZzgim3EFPGWFv0jNDCKKV1VR1CM0al9gHj4XubJMdfImTfe0qfGOu6aX6zW4bZhni5/QE)
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 8 bytes
Two solutions:
```
{@LRQ.pT
{[[email protected]](/cdn-cgi/l/email-protection)
```
[Try it online!](https://tio.run/##K6gsyfj/v9rBJyhQryDk//9oAx0FQzAyiAUA "Pyth – Try It Online")
Standard method - index into permutations of `[0, 1, ..., 9]`.
[Try it online!](https://tio.run/##K6gsyfj/v9rZIShIryDk//9oAx0FQzAyiAUA "Pyth – Try It Online")
Reverse the order of indexing - generate separate lists of all 0th, 1st, etc. elements of the permutations, then transpose.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), ~~87~~ 85 bytes
-2 thanks to @ovs
```
lambda s:[c for i in range(10000)if len({*s})==len({*zip(s,c:='%04i'%i)})==len({*c})]
```
[Try it online!](https://tio.run/##K6gsycjPM7YoKPqfZhvzPycxNyklUaHYKjpZIS2/SCFTITNPoSgxLz1Vw9AACDQz0xRyUvM0qrWKazVtbSHMqswCjWKdZCtbdVUDk0x11UxNhFxyrWbs/4KizLwSjTQNdUcnJ2d1Tc3/0YY6RkBoHAsA "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 107 bytes
```
sub{my%s;my$r;$r.=$s{$_}++?"\\$_":'((?!'.join('|',map"\\$_",1..keys%s).')\d)'for@_;grep/$r/,'0000'..'9999'}
```
[Try it online!](https://tio.run/##XZbdTiNHEIXveYpeZ8jYMDFV/TczWF4Im7tI2ZvcxRFKhNk4C7bXZrVBhNs8QB4xL0LqG8gwSiMdCc2Znq@ruo68Xe5u0lNxPX/af/714fb@cD@7vS92s2I3nRf7h@Ly8fj4bLRYFJej03I8PntTTn/frNbj8s@yuv1l@/yk0un04/J@f7ifTMvJ4mpSXm9255ezD7vl9qTYnVSl2Cqn07K1VT4@zey5u713xd1yf@fGBz@V39oq3fyt@/RljNmpLedtuWDLRVsu2XLZlqttucaWY8fJz9XzFheDLdSZeCQgEUlIRmqkQVo@1X3PIwGJSEIyUiMN0oIkSAcXkIgkJCP1fzQXgwPZBwwGCUhEEpKRGmmQFhBDNxgkIBFJSEZqpEFaGOyIBoMEJCIJyUjte5pBbZTaeGoTqE2kNonaZGpTU5uG2rTUpuuFpzaB2kRqk6hNpjY1tWmoTUtthNp0jQvUJlKbRG0ytalfa/NuQAOIAqKAKCAKiAKigFjdDbijxufxeXwen8fn8Xl8AV/oTocv4Av4Ar6AL@CL@kJzMbh6HFc4hjXKJCIJyUiNNEhLWSikclxrlElEEpKRGmmQlopQcE8hrVEmEUlIRmrve5qLAY1C46EJ0ERoEjQZmhqaBpoWGoHGQxOgidAkaDI0NTQNNC00Ao1CE6CJ0CRoMjR1T/NuQGMgCogCooAoIAqIAqIGYlt31AGJSEIyUiMN0nImRbrTRSQhGamRBmk5dt@pwUwxtMIw2iWmU8xUYqYyM1UzUw0z1TJTxIEytHaJ6RQzlZipzEzVzFTDTLXMFLHhiQO7xHSKmUrMVGam6n6mLgYzRVoJaSWklZBWQloJaSWklZBWRkOnuDyYFbNiVsyKWTErZsXsMfsuDDF7zB6zx2w0facGMwW8kGVClglZJmSZkGVClglZJlREiDEhxoQYE2LMhE4xU56ZomhCMUzoFDMVmKnATAVmKjBT8XWm3g06RZOUJilNUpqkNElpktIkbWlm11F8Hp/H5/F5fB6fxxfwha7z@AK@gC/gC/gCvqjS0ww6xZlJViFZhWQVklVIViFZhWQVJkkIVSFUhVAVQtVokAZpqQhlZoiMBklIRmqkQVquhMaeZtAprgzJKiSrkKxCsgrJKiSrkKziu/uFj1AVQlUIVaOhU/g8PoJIQncP8QV8AV/AF/AFfJZVPc13AxpAuArKVVCugnIVlKugXAUNHTAWboFyC5RboNwC5RYo9dLYnQlLxBKxRCwRC9VUSqWpO3aGZvJw4Gzd3o@L1XpbnS//2E7m592PhNnLE3duT@b2y8N9k@PxZndVuf32ZnV3clLxzgzXV45hcP/89bfTyttf6F/@sLmbf11cj9ll8rzndrda3127Ea@fusN41b04quQY94tns@Uf9@W31c2y2@UtcD1UYf/Mn38XVeUz9@szvvn6zP4bPNt8nPOuW37qfAMinrkzNzLtHo2m4@67KmdlNbWfUqdlOXGnrjw6Ovrh/Y/u/ffl8O3RYg0Tmy/WELDHYj1yq2v3xrb@n3c0O3h8@hc "Perl 5 – Try It Online")
]