pub fn critical_window(cases: &[usize]) -> Window {
        let mut w = Window {
            l: K - 1,
            r: K - 1,
        };
        let mut w_max = w;
        for b in (0..K).rev() {
            w.r = b;
            if w.is_critical(cases) {
                w_max = w;
            } else {
                w.l -= 1;
                if w.mapped_cardinality(cases) > w_max.mapped_cardinality(cases) {
                    w_max = w;
                }
            }
        }

        w_max
    }
/// Find the longest critical window, and the most critical window of that length.
Find the longest critical window, and the most critical window of that length.
Find the longest critical window and the most critical window of that length .
pub fn critical_window(cases: &[usize]) -> Window {
        let mut w = Window {
            l: K - 1,
            r: K - 1,
        };
        let mut w_max = w;
        for b in (0..K).rev() {
            w.r = b;
            if w.is_critical(cases) {
                w_max = w;
            } else {
                w.l -= 1;
                if w.mapped_cardinality(cases) > w_max.mapped_cardinality(cases) {
                    w_max = w;
                }
            }
        }
        w_max
    }
pub fn critical_window ( cases : & [ usize ] ) -> Window { let mut w = Window { l : K - 1 , r : K - 1 , } ; let mut w_max = w ; for b in ( 0 .. K ) . rev ( ) { w . r = b ; if w . is_critical ( cases ) { w_max = w ; } else { w . l -= 1 ; if w . mapped_cardinality ( cases ) > w_max . mapped_cardinality ( cases ) { w_max = w ; } } } w_max }
Find the longest critical window, and the most critical window of that length.
Find the longest critical window and the most critical window of that length .
cases
&[usize]
cases
&[usize]