JWT time claims validation
Validate the time-based claims of an already-decoded JWT payload (signature verification is out of scope). Given the claims dict and the current Unix time 'now', return 'valid' only if all present time claims pass: 'exp' (expiry) must be strictly greater than now, 'nbf' (not-before) must be <= now, and 'iat' (issued-at) must be <= now. A 'leeway' in seconds is allowed in the candidate's favor on each bound. Missing claims are skipped. Return the first failure as 'expired', 'not_yet_valid', or 'issued_in_future' in that check order, else 'valid'.
validate_jwt_claims(claims: dict, now: int, leeway: int) → str[{"exp":2000,"iat":1000,"nbf":1000},1500,0]out"valid"State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
[{"exp":2000,"iat":1000,"nbf":1000},1500,0]"valid"not run yetsample