NQKFZ2HDGY562EU7GKIMOKTYVMZEKMJN5LZU7CUZQOBPUPDK5WBQC
// Might not work properly if results of `powi`s don't fit into the `usize` casts.
fn integer_range_length(start: usize, end: usize) -> usize {
let (start_digits, end_digits) = (integer_length(start), integer_length(end));
// Present conversions and type casts could be problematic for certain inputs.
fn range_digits(start: usize, end: usize) -> usize {
let (start_digits, end_digits) = (digits(start), digits(end));
(integer_length(a + 1)..=integer_length(b - 1)).fold(0, |acc, elem| {
acc + 9 * elem * (10_f64.powi((elem - 1).try_into().unwrap()) as usize)
(digits(a + 1)..=digits(b - 1)).fold(0, |acc, elem| {
acc + 9 * elem * 10_usize.pow((elem - 1).try_into().unwrap())