3 ms·
Can you solve the exact same problem using Python list comprehensions or Rust iterators? I'd like to see how solving this same problem in those languages is le
by fluffything 7y ago
Can you solve the exact same problem using Python list comprehensions or Rust iterators?
I'd like to see how solving this same problem in those languages is less of a nightmare.
I personally find that C loop quite readable compared with the same iteration being done in Rust.
- pcwalton 7y agoThis is a sum of absolute differences, so in Rust: let satd = d.iter().cloned().map(abs).sum(); As an added bonus, there's no undefined behavior!