C++ ranges and views

F-RANGES-V4-2medium

Clear sold-out scents

A candle shop restocks lots, clears sold-out scents and reports orders with C++ ranges.

What needs to change

Repair clearSoldOut so sold-out scents leave the shelf.

Reproduce

  1. Build with clang++ -std=c++2c -Wall -Wextra -pedantic main.cpp -o main, then pipe the sample scents into ./main and compare the shelf lines with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its headers, readLines, the Item struct, parse and the complete main.

Input: up to 50 scent/count records, one per line, with ordinary spaces/tabs between fields. A scent is an opaque nonempty token and counts are decimal integers from 0 through 1000; leading zeros denote the same numeric count. The supplied reader receives valid records.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in