Reading a little assembly

R-ASM-V4-3hard

Rebuild the shift count

A checkout service is replacing a platform-specific carrier-rate helper. Reconstruct these small helpers from the supplied reference release listings so the port keeps their returned values. In quote and capped commands, base is cents and pounds is a signed adjustment to billable pounds relative to that base quote, so a reweigh can make it negative. Inputs are between -1000000 and 1000000; all correct intermediate results fit signed 32-bit values. The program reads one well-formed command per line and prints one result. These are lesson-authored compiler artifacts, not a real vendor archive.

What needs to change

Rebuild shiftsLeft so it returns what its reference listing computes.

Reproduce

  1. Run the sample with go run: shifts 80. Compare the printed number with the expected stdout, then try the fixtures past the cutoff.

Acceptance criteria

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

Notes

quote and cappedQuote are supplied. The listing above shiftsLeft comes from go1.27.3 for GOARCH=arm64. Negative hours mean the pickup cutoff has passed.

Sign in to open this exercise

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

Sign in