Results for “Iterators & transformations”
Small, practical examples. Search by task or narrow things down below.
Accumulate a result with fold
Accumulate a result with fold in a complete Rust program using the standard library.
Rust✓ Tested
Find the first matching value
Find the first matching value in a complete Rust program using the standard library.
Rust✓ Tested
Flatten nested collections
Flatten nested collections in a complete Rust program using the standard library.
Rust✓ Tested
Number items while iterating
Number items while iterating in a complete Rust program using the standard library.
Rust✓ Tested
Pair corresponding values
Pair corresponding values in a complete Rust program using the standard library.
Rust✓ Tested
Parse only valid integers
Parse only valid integers in a complete Rust program using the standard library.
Rust✓ Tested
Partition values into two collections
Partition values into two collections in a complete Rust program using the standard library.
Rust✓ Tested
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Transform each value with map
Transform each value with map in a complete Rust program using the standard library.
Rust✓ Tested
Calculate a cumulative sum for each position
C: Keep a running total and store each prefix result in a separate output array.
C✓ Tested
Calculate a product with Aggregate
C#: Supply a seed to define the result for an empty sequence.
C#✓ Tested
Calculate several numeric stream statistics
Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.
Java✓ Tested