[−][src]Function competitive_hpp::prelude::diff_with
pub fn diff_with<I, J, F>(
i: I,
j: J,
is_equal: F
) -> Option<Diff<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter>> where
F: Fn(&<I as IntoIterator>::Item, &<J as IntoIterator>::Item) -> bool,
I: IntoIterator,
J: IntoIterator,
Compares every element yielded by both i and j with the given function in lock-step and
returns a Diff which describes how j differs from i.
If the number of elements yielded by j is less than the number of elements yielded by i,
the number of j elements yielded will be returned along with i's remaining elements as
Diff::Shorter.
If the two elements of a step differ, the index of those elements along with the remaining
elements of both i and j are returned as Diff::FirstMismatch.
If i becomes exhausted before j becomes exhausted, the number of elements in i along with
the remaining j elements will be returned as Diff::Longer.