The standard library and third-party packages

F-PACKAGES-V4-2medium

Honor one leading marker

A noticeboard reads labels, removes one optional leading tag: marker, then applies a simultaneous rename table.

What needs to change

Repair cleanLabel so its result follows the one-leading-marker policy.

Reproduce

  1. Use `clang++ -std=c++2c -Wall -Wextra -pedantic main.cpp -o program && ./program` with the ticket’s sample stdin; compare the full clean report.

Acceptance criteria

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

Notes

main.cpp supplies words and the cleanLabel caller. tag: is the exact optional marker; any other characters belong to the label.

Input is LF/CRLF-delimited ASCII text: the first line contains labels, the second is a decimal rule count from 0 through 20, and each following rule line contains a source and destination separated by ordinary spaces or tabs. Surrounding space/tab framing and leading zeros or a plus sign on the count are accepted.

The first line has at most 50 labels. Each label, rule source and destination is a nonempty ASCII token of at most 64 characters without whitespace; each physical line is at most 4096 bytes. Rule sources are unique and destinations are nonempty literal text. The supplied reader receives valid data.

Sign in to open this exercise

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

Sign in