Company: Amazon_9may
Difficulty: medium
Return Routing An e-commerce platform must decide what to do with every return request a customer files. Some returns are approved automatically, some are queued for a human, and some are rejected outright. The decision is driven by two things: policy (is the category returnable, and is the request still inside the return window?) and risk (how much returning has this customer already done, counting every account they are linked to?). In the original task the routing engine reads six data files ( data/category_rules.json , data/scoring_rules.json , data/decision_bands.json , data/account_profiles.jsonl , data/account_links.jsonl , data/returns.jsonl ) and writes data/results.jsonl . Here the six files arrive on standard input as six sections of plain whitespace-separated lines, and the results are printed to standard output. (inferred -- the file-based project is turned into one stdin/stdout program) Complete the function solve(categoryRules, scoringRules, decisionBands, accountProfile