diff --git a/src/algorithm/inversion_number.rs b/src/algorithm/inversion_number.rs index 4430ce6..57c6406 100644 --- a/src/algorithm/inversion_number.rs +++ b/src/algorithm/inversion_number.rs @@ -1,8 +1,8 @@ //! 転倒数 -pub fn inversion_number(array: &[i64]) -> i64 { +pub fn inversion_number(array: &[T]) -> i64 { count_merge(&mut array.to_vec(), 0..array.len()) } -fn count_merge(array: &mut Vec, range: std::ops::Range) -> i64 { +fn count_merge(array: &mut Vec, range: std::ops::Range) -> i64 { let length = range.len() as i64; if length <= 1 { return 0;