bad_numbers
.i
of the fronts
and backs
arrays.
fronts[i]
is equal to backs[i]
, add fronts[i]
to the bad_numbers
set.min_good
to a large number (e.g., float('inf')
in Python or Integer.MAX_VALUE
in Java).fronts
and backs
arrays.
bad_numbers
and is less than min_good
, update min_good
with this number.min_good
remains unchanged, return 0 as there are no good integers.min_good
as the minimum good integer.