Given the interface IntIterator
defined in the following, implement the method isDistanceZeroOrOne(IntIterator a, IntIterator b)
to return if the distance between a
and b
is at most one, where the distance is defined as the minimum number of modifications to make them equal to each other. Modifications can be: 1) change an int in a
. 2) insert an int to a
. 3) remove an int from a
. For example, the method should return true
for 1, 2, 2 and 1, 3, 2, 2.