@@ -158,7 +158,7 @@ fn matrix_multiply(multiplier: &[Vec<u128>], multiplicand: &[Vec<u128>]) -> Vec<
158158 // of columns as the multiplicand has rows.
159159 let mut result: Vec < Vec < u128 > > = vec ! [ ] ;
160160 let mut temp;
161- // Using variable to compare lenghts of rows in multiplicand later
161+ // Using variable to compare lengths of rows in multiplicand later
162162 let row_right_length = multiplicand[ 0 ] . len ( ) ;
163163 for row_left in 0 ..multiplier. len ( ) {
164164 if multiplier[ row_left] . len ( ) != multiplicand. len ( ) {
@@ -195,7 +195,7 @@ pub fn nth_fibonacci_number_modulo_m(n: i64, m: i64) -> i128 {
195195fn get_pisano_sequence_and_period ( m : i64 ) -> ( i128 , Vec < i128 > ) {
196196 let mut a = 0 ;
197197 let mut b = 1 ;
198- let mut lenght : i128 = 0 ;
198+ let mut length : i128 = 0 ;
199199 let mut pisano_sequence: Vec < i128 > = vec ! [ a, b] ;
200200
201201 // Iterating through all the fib numbers to get the sequence
@@ -213,12 +213,12 @@ fn get_pisano_sequence_and_period(m: i64) -> (i128, Vec<i128>) {
213213 // This is a less elegant way to do it.
214214 pisano_sequence. pop ( ) ;
215215 pisano_sequence. pop ( ) ;
216- lenght = pisano_sequence. len ( ) as i128 ;
216+ length = pisano_sequence. len ( ) as i128 ;
217217 break ;
218218 }
219219 }
220220
221- ( lenght , pisano_sequence)
221+ ( length , pisano_sequence)
222222}
223223
224224/// last_digit_of_the_sum_of_nth_fibonacci_number(n) returns the last digit of the sum of n fibonacci numbers.
@@ -328,7 +328,7 @@ mod tests {
328328 }
329329
330330 #[ test]
331- /// Check that the itterative and recursive fibonacci
331+ /// Check that the iterative and recursive fibonacci
332332 /// produce the same value. Both are combinatorial ( F(0) = F(1) = 1 )
333333 fn test_iterative_and_recursive_equivalence ( ) {
334334 assert_eq ! ( fibonacci( 0 ) , recursive_fibonacci( 0 ) ) ;
0 commit comments