left and right. Find the smallest positive integer whose decimal form contains at least one digit from left and at least one digit from right.left=[6, 2, 8], right=[4, 9] → 24
There is no common digit, so a two-digit number is needed: the smallest digits 2 from left and 4 from right give 24.
left=[7, 5, 1], right=[3, 5] → 5
The digit 5 is in both sets, so the single-digit 5 works.
left=[9], right=[8] → 89
left=[6, 2, 8], right=[4, 9]
24
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.