From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
Format as string and separate into an array of single digits, then start reading here. Scan back into numeric if desired.
Is it always four digits or can it be any number of digits? For very long inputs, you might run out of memory.
(Of course if some values are in duplicate, you need to filter at the end to only retain the unique results (e.g. 7745 has duplicates while an input of 4444 only has exactly one solution). removing duplicates is easy, though. See how far you get. You could even avoid storing duplicates by accumulating results into a "set".