Displaying posts tagged with

“rust”

Rust Bytes: ZigZag Merge

The task involves creating an iterator that merges two input iterators of i32 by alternating values from each until both are exhausted. The solution includes a Zigzag struct with a next method for alternating yields. Test cases verify correct functionality but one assertion fails regarding handling an empty iterator.

Rust Bytes: Group by Frequency

Given a list of integers, return a vector of vectors where each inner vector contains all numbers that appear the same number of times, grouped by frequency.