Hello
I'm trying to make a better code for the snippet i created here :
let mut result: Vec<(usize, usize)> = vec![];
for row in 0..input.len() {
for col in 0..input[row].len() {
if less_equals_column(input, (row, col)) && greater_equals_row(input, (row, col)) {
result.push((row, col));
}
}
}
result
I want to do the same with iterators map and filter.
I tried this , but I don't manage to do it.
(0..input.len()).map(|row|{
(0..input[row].len()).into_iter().any(|col|
less_equals_column(input, (row, col)) && greater_equals_row(input, (row, col)
))}).collect()
someone could help me please ?