20 lines
423 B
Rust
20 lines
423 B
Rust
|
pub fn is_legitimate(pool: &[Vec<u8>]) -> Option<bool> {
|
||
|
for row in pool {
|
||
|
if *row.first()? == 1 || *row.last()? == 1 {
|
||
|
return Some(false);
|
||
|
}
|
||
|
}
|
||
|
for first_row in pool.first()? {
|
||
|
if *first_row == 1 {
|
||
|
return Some(false);
|
||
|
}
|
||
|
}
|
||
|
for last_row in pool.last()? {
|
||
|
if *last_row == 1 {
|
||
|
return Some(false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Some(true)
|
||
|
}
|