aboutsummaryrefslogtreecommitdiff
path: root/2022/07/a.rs
blob: a0d9a1ae9188e4d0b661abeac438c0ed6f3a78f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
mod common;
use common::*;

fn main() {
    let fs = FileSystem::build_from_stdin();
    let sum: usize = fs.iter()
        .filter(|f| matches!(f.kind, FileType::Directory(_)))
        .map(|f| f.real_size(&fs))
        .filter(|s| *s <= 100000)
        .sum();
    println!("{sum}");
}

Generated with cgit - Back to sebastiano.tronto.net