/// Return the next permutation, until all of them have been visited.
Return the next permutation, until all of them have been visited.
Return the next permutation until all of them have been visited .
fn next(&mut self) -> Option<(usize, usize)> {
        while self.i < self.ks.len() {
            if self.ks[self.i] < self.i {
                let result = if self.i % 2 == 0 {
                    (0, self.i)
                } else {
                    (self.ks[self.i], self.i)
                };
                self.ks[self.i] += 1;
                self.i = 0;
                return Some(result);
            } else {
                self.ks[self.i] = 0;
                self.i += 1;
            }
        }
        None
    }
fn next ( & mut self ) -> Option < ( usize , usize ) > { while self . i < self . ks . len ( ) { if self . ks [ self . i ] < self . i { let result = if self . i % 2 == 0 { ( 0 , self . i ) } else { ( self . ks [ self . i ] , self . i ) } ; self . ks [ self . i ] += 1 ; self . i = 0 ; return Some ( result ) ; } else { self . ks [ self . i ] = 0 ; self . i += 1 ; } } None }
Return the next permutation, until all of them have been visited.
Return the next permutation until all of them have been visited .
&mut self