fn try_rows(input: &Vec<usize>, columns: usize, width: usize) -> bool {

        let lines_amt = (input.len() / columns) + 1;

        let sum_line_widths = |widths_list: Vec<usize>| -> usize {
            widths_list.iter().fold(0, |x, y| { x + *y})
        };

        sum_line_widths(
            split_into_columns(input, columns, lines_amt).iter().map(
                longest_word
            ).collect()
        ) <= width
    }
/// Tests wheter a vector of words, split into a certain number of columns fits into given width
Tests wheter a vector of words, split into a certain number of columns fits into given width
Tests wheter a vector of words split into a certain number of columns fits into given width
fn try_rows(input: &Vec<usize>, columns: usize, width: usize) -> bool {
        let lines_amt = (input.len() / columns) + 1;
        let sum_line_widths = |widths_list: Vec<usize>| -> usize {
            widths_list.iter().fold(0, |x, y| { x + *y})
        };
        sum_line_widths(
            split_into_columns(input, columns, lines_amt).iter().map(
                longest_word
            ).collect()
        ) <= width
    }
fn try_rows ( input : & Vec < usize > , columns : usize , width : usize ) -> bool { let lines_amt = ( input . len ( ) / columns ) + 1 ; let sum_line_widths = | widths_list : Vec < usize > | -> usize { widths_list . iter ( ) . fold ( 0 , | x , y | { x + * y } ) } ; sum_line_widths ( split_into_columns ( input , columns , lines_amt ) . iter ( ) . map ( longest_word ) . collect ( ) ) <= width }
Tests wheter a vector of words, split into a certain number of columns fits into given width
Tests wheter a vector of words split into a certain number of columns fits into given width
input
&Vec<usize>
columns
usize
width
usize