tested-best-bank-v2-reviewed
Separate measurement contract · 1 measured cohort · 07a1f808bc18
| Measured UTC | Pass rate | 95% band | Attempts | Responses | Provider failures | Median latency | Capped / refusal flags | Receipts |
|---|---|---|---|---|---|---|---|---|
| 2026-10-05 05:54 | 100.0% | 100.0%–100.0% | 36 / 36 | 36 / 36 | 0 | 3.02 s | 0 / 0 | Original JSON |
Measurement contract and limitations
- Task-bank SHA-256
- fce29b4d66cfddeab39632d451935271a37df595374b40eacd300201e3726291
- Protocol SHA-256
- 90b114dd8a70ecbf3aecc35f58cea1ba85c786554aee9835a38a1c518293da05
- Grader contract
- 62980813a06357fd89c914858db26855ffe2bd65a7e18f326d827fb6610e7e23
- Model configuration
- 04e4af3ce275b597cf00f2c7dc53d1c4bd14f4df1016870506fb403d1da26a0e
One point is one cohort, not a week of daily tests.
Exact returned model identity was validated by the source runner; the public projection exposes the admitted ID and response hash.
Hidden fixtures and private transport responses remain with the source owner.
Inspect 36 retained attempts
coding-reconcile · repeat 2 · Pass
checked · responded · 2026-10-05T05:49:02.158863+00:00 UTC
Request: req_57a38056553f4c288af96afbf2cc4850. Estimated cost: US$0.001834. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
def solve(data):
balances = {}
for invoice in data["invoices"]:
key = invoice["id"]
balances[key] = balances.get(key, 0) + invoice["cents"]
for payment in data["payments"]:
key = payment["id"]
balances[key] = balances.get(key, 0) - payment["cents"]
return {key: balances[key] for key in sorted(balances) if balances[key] != 0}Response SHA-256: 2afdb4be0b93334307023e0a767f2fabf3d490ac3b9e13fcde7d523e52195ec9
coding-rate · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:24.422196+00:00 UTC
Request: req_29a8e148edb74242bb21fcb0320077d5. Estimated cost: US$0.002098. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import deque
def solve(data):
limit = data["limit"]
window = data["window"]
accepted = {}
result = []
for event in data["events"]:
user = event["user"]
time = event["time"]
if user not in accepted:
accepted[user] = deque()
times = accepted[user]
cutoff = time - window
while times and times[0] <= cutoff:
times.popleft()
allowed = len(times) < limit
result.append(allowed)
if allowed:
times.append(time)
return resultResponse SHA-256: 792a6affd665dd677a7f424d70ef3806b3f30bca301ca4ab85ce1ac64b570768
coding-fifo · repeat 2 · Pass
checked · responded · 2026-10-05T05:49:34.375916+00:00 UTC
Request: req_d94adde21e7d4346b5fe3616631b4a57. Estimated cost: US$0.001982. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
unfilled = data["sold"]
remaining_units = 0
remaining_value_cents = 0
for quantity, unit_cents in data["lots"]:
consumed = min(quantity, unfilled)
unfilled -= consumed
remaining = quantity - consumed
remaining_units += remaining
remaining_value_cents += remaining * unit_cents
return {
"remaining_units": remaining_units,
"remaining_value_cents": remaining_value_cents,
"unfilled_units": unfilled
}Response SHA-256: b9356686672cca8243fccd15e9b10b9106444327d2a163211ef1916727055742
coding-redact · repeat 3 · Pass
checked · responded · 2026-10-05T05:54:23.793169+00:00 UTC
Request: req_3c7ac93e940e407cb6e16938d7b31dd0. Estimated cost: US$0.001464. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
key: solve(value)
for key, value in data.items()
if key.lower() not in ("password", "token", "secret")
}
if isinstance(data, list):
return [solve(value) for value in data]
return dataResponse SHA-256: 200a8ae0a531f9170d4945d617a4399d4fd89e39ca24e42fa566a971da3baf07
coding-intervals · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:22.666761+00:00 UTC
Request: req_9017598c4d1c456b9f4ab2e9b604a273. Estimated cost: US$0.001596. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
intervals = sorted((start, end) for start, end in data if start < end)
merged = []
for start, end in intervals:
if merged and start <= merged[-1][1]:
merged[-1][1] = max(merged[-1][1], end)
else:
merged.append([start, end])
return mergedResponse SHA-256: d6f04ba6da56f709e2c643707cdec4c2aecff9257f7ab351e3c62a65d61ad677
coding-csv · repeat 2 · Pass
checked · responded · 2026-10-05T05:49:14.818536+00:00 UTC
Request: req_3d94177f7dfa48419867fa612095398b. Estimated cost: US$0.002182. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
def solve(data):
totals = {}
pattern = re.compile(r"[+-]?[0-9]+")
rows = csv.reader(io.StringIO(data))
next(rows, None)
for row in rows:
if len(row) != 2:
continue
customer, cents = row
if not customer.strip():
continue
cents = cents.strip()
if pattern.fullmatch(cents) is None:
continue
totals[customer] = totals.get(customer, 0) + int(cents)
return totalsResponse SHA-256: f47afffd99657df19718468f4646d9bc8e1d530ea8afdbcc7217911afcab3a81
coding-rolling · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:33.123620+00:00 UTC
Request: req_96c7101eef014ad0ae6bf96bad7326ba. Estimated cost: US$0.002236. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
def solve(data):
events = sorted(data["events"])
prefix = [0]
days = []
for day, count in events:
days.append(day)
prefix.append(prefix[-1] + count)
def upper_bound(value):
lo, hi = 0, len(days)
while lo < hi:
mid = (lo + hi) // 2
if days[mid] <= value:
lo = mid + 1
else:
hi = mid
return lo
return [
prefix[upper_bound(q)] - prefix[upper_bound(q - 7)]
for q in data["query_days"]
]Response SHA-256: 01016485ff53eab19a63a9d40f267e9e84f859fafbbe06a8d139deaa863cf210
coding-allocate · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:00.627293+00:00 UTC
Request: req_6692f225837b41e192234da30f2dc4ff. Estimated cost: US$0.002124. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
total = data["total"]
weights = data["weights"]
weight_sum = sum(weights)
if not weights:
return []
if weight_sum == 0:
return [0 for _ in weights]
shares = [divmod(total * weight, weight_sum) for weight in weights]
result = [share[0] for share in shares]
leftover = total - sum(result)
order = sorted(range(len(weights)), key=lambda i: (-shares[i][1], i))
for i in order[:leftover]:
result[i] += 1
return resultResponse SHA-256: be3e896df607641e60689053c1847b3bf85bba16e6ba768c5a9b36929fbbd28a
coding-reconcile · repeat 1 · Pass
checked · responded · 2026-10-05T05:44:15.029141+00:00 UTC
Request: req_181c17b5162f498c94a135bddaef5864. Estimated cost: US$0.001924. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
def solve(data):
balances = {}
for invoice in data["invoices"]:
identifier = invoice["id"]
balances[identifier] = balances.get(identifier, 0) + invoice["cents"]
for payment in data["payments"]:
identifier = payment["id"]
balances[identifier] = balances.get(identifier, 0) - payment["cents"]
return {
identifier: balances[identifier]
for identifier in sorted(balances)
if balances[identifier] != 0
}Response SHA-256: 6419b5d654102cbe5bf69ea7fbb655e13d8f82d6b519658bbc50ab8bde0c03f1
coding-slug · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:39.276883+00:00 UTC
Request: req_8c3f1a7b618e4e16a706a66a694dad19. Estimated cost: US$0.001484. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import unicodedata
import re
def solve(data):
normalized = unicodedata.normalize("NFKD", data)
text = "".join(char for char in normalized if not unicodedata.combining(char)).lower()
return re.sub("[^a-z0-9]+", "-", text).strip("-")Response SHA-256: e7a06e9ecab4745318aeb619f856d521ac06e43745b59200be55c2311d954eaf
coding-allocate · repeat 3 · Pass
checked · responded · 2026-10-05T05:54:02.190178+00:00 UTC
Request: req_56846c3985a84e1e813a4c71043b785a. Estimated cost: US$0.002064. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
total = data["total"]
weights = data["weights"]
weight_sum = sum(weights)
if not weights or weight_sum == 0:
return [0 for _ in weights]
shares = [divmod(total * weight, weight_sum) for weight in weights]
result = [share[0] for share in shares]
remaining = total - sum(result)
order = sorted(range(len(weights)), key=lambda i: (-shares[i][1], i))
for i in order[:remaining]:
result[i] += 1
return resultResponse SHA-256: b4cc91d5a79ca293613d5967b69c04625b54ed49499716dbc3b2787fad388aad
coding-intervals · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:52.930979+00:00 UTC
Request: req_333c2fa527d94444a73fd077eb8b81fa. Estimated cost: US$0.001586. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
intervals = sorted((start, end) for start, end in data if start < end)
result = []
for start, end in intervals:
if result and start <= result[-1][1]:
result[-1][1] = max(result[-1][1], end)
else:
result.append([start, end])
return resultResponse SHA-256: 6c68abdd2604589beb9238056c4f8b5b04f5b49f9d43d6ed6ec3502d3db67f64
coding-percentile · repeat 3 · Pass
checked · responded · 2026-10-05T05:52:32.612721+00:00 UTC
Request: req_024853f3428a49788b697fd7a0ca055c. Estimated cost: US$0.001358. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = sorted(data["values"])
if not values:
return None
rank = max(1, math.ceil(data["p"] / 100 * len(values)))
return values[rank - 1]Response SHA-256: aa116347541fdec01e96a87fd1976c728134e10f8241611c0bee1a2084f0467b
coding-fifo · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:46.329348+00:00 UTC
Request: req_468a41a0b4df41c3ba85b9f4382f64ae. Estimated cost: US$0.002072. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
to_sell = data["sold"]
remaining_units = 0
remaining_value_cents = 0
for quantity, unit_cents in data["lots"]:
sold_from_lot = min(quantity, to_sell)
to_sell -= sold_from_lot
remaining = quantity - sold_from_lot
remaining_units += remaining
remaining_value_cents += remaining * unit_cents
return {
"remaining_units": remaining_units,
"remaining_value_cents": remaining_value_cents,
"unfilled_units": to_sell
}Response SHA-256: 02880cbcbdd4eab11d64698e36b70d423f2c66477fe1b56780ec22a009b23321
coding-percentile · repeat 1 · Pass
checked · responded · 2026-10-05T05:41:31.663853+00:00 UTC
Request: req_3e90e714967942d18d98e75b8750771f. Estimated cost: US$0.001358. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = sorted(data["values"])
if not values:
return None
rank = max(1, math.ceil(data["p"] / 100 * len(values)))
return values[rank - 1]Response SHA-256: c0bd5d646de5e2c827911d6431554311db98cbe98221224fc7d384d85bdc18fd
coding-percentile · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:15.748177+00:00 UTC
Request: req_f1a1db7191c14c06947f119c240215aa. Estimated cost: US$0.001418. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = data["values"]
if not values:
return None
ordered = sorted(values)
rank = max(1, math.ceil(data["p"] / 100 * len(ordered)))
return ordered[rank - 1]Response SHA-256: 31e621043751744ec8ad1454775cac68a273b861e92e0296dc5d2a545c0b60b5
coding-rolling · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:52.785459+00:00 UTC
Request: req_0bcc89c139be4f95acc21dd3ae99778f. Estimated cost: US$0.002246. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
def solve(data):
events = sorted(data["events"])
queries = sorted(enumerate(data["query_days"]), key=lambda item: item[1])
results = [0] * len(queries)
left = 0
right = 0
total = 0
for index, day in queries:
while right < len(events) and events[right][0] <= day:
total += events[right][1]
right += 1
while left < right and events[left][0] < day - 6:
total -= events[left][1]
left += 1
results[index] = total
return resultsResponse SHA-256: 457c573b372e2e0e63c74937da686fe1e469234b7c1be4af23243138c702bf3f
coding-redact · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:46.456076+00:00 UTC
Request: req_c7a1a9aa3c904c93b7cd5073f192156b. Estimated cost: US$0.001464. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
key: solve(value)
for key, value in data.items()
if key.lower() not in ("password", "token", "secret")
}
if isinstance(data, list):
return [solve(value) for value in data]
return dataResponse SHA-256: fe87bc2b308c0a0d8287734ad223124d1b1f8ab6cc3c90a1591ffdb7be77259a
coding-intervals · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:36.943395+00:00 UTC
Request: req_7c29796587d04c9b9a3f2ea78112698d. Estimated cost: US$0.001596. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
intervals = sorted((start, end) for start, end in data if start < end)
merged = []
for start, end in intervals:
if merged and start <= merged[-1][1]:
merged[-1][1] = max(merged[-1][1], end)
else:
merged.append([start, end])
return mergedResponse SHA-256: 47f79bd834a178a604e0fae90bf59f5af850a34891c9fb77b1ab9d9ff7513daa
coding-csv · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:31.741334+00:00 UTC
Request: req_5caed2c2b73845b2a8c52080d3911c0d. Estimated cost: US$0.002732. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
def solve(data):
rows = csv.reader(io.StringIO(data))
next(rows, None)
totals = {}
for row in rows:
if len(row) != 2:
continue
customer, cents = row
if not customer.strip():
continue
cents = cents.strip()
if re.fullmatch(r"[+-]?[0-9]+", cents) is None:
continue
totals[customer] = totals.get(customer, 0) + int(cents)
return totalsResponse SHA-256: e3284f1d9a0d4c70ce283a063cf59ebc10e24dc9ad889a4c7aef30b06e5c4c05
coding-dedup · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:07.263934+00:00 UTC
Request: req_f234aa376dd646ae884dd5f40d46063b. Estimated cost: US$0.001458. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
retained = {}
for item in data:
identifier = item["id"]
if identifier not in retained or item["version"] >= retained[identifier]["version"]:
retained[identifier] = item
return [retained[identifier] for identifier in sorted(retained)]Response SHA-256: cfcdbab66f0ba11ffc7c5f14f769a27b854419d952c3f6f4a97d047015f9ff0b
coding-rolling · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:02.009936+00:00 UTC
Request: req_c2cd70fb93664c10a7ad8179b37232cc. Estimated cost: US$0.004096. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
def solve(data):
events = sorted(data["events"])
queries = sorted((day, i) for i, day in enumerate(data["query_days"]))
result = [0] * len(queries)
left = 0
right = 0
total = 0
n = len(events)
for day, index in queries:
while right < n and events[right][0] <= day:
total += events[right][1]
right += 1
start = day - 6
while left < right and events[left][0] < start:
total -= events[left][1]
left += 1
result[index] = total
return resultResponse SHA-256: 48b5f3d6fbe97b7e589422774cc3a88c9ce19e6792a10c1e07ddea457d429019
coding-redact · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:24.276306+00:00 UTC
Request: req_0f5fe8b664f54a8ea63b94b0e45a7582. Estimated cost: US$0.001464. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
key: solve(value)
for key, value in data.items()
if key.lower() not in ("password", "token", "secret")
}
if isinstance(data, list):
return [solve(value) for value in data]
return dataResponse SHA-256: 78188a2a1b2719f69e84693d0e6c018ce1c1999a73c85ca9bf960937216a984e
coding-rate · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:29.268419+00:00 UTC
Request: req_33afdc58321c4f40b296836d57dc0ab6. Estimated cost: US$0.002098. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import deque
def solve(data):
limit = data["limit"]
window = data["window"]
accepted = {}
results = []
for event in data["events"]:
user = event["user"]
time = event["time"]
if user not in accepted:
accepted[user] = deque()
queue = accepted[user]
cutoff = time - window
while queue and queue[0] <= cutoff:
queue.popleft()
allowed = len(queue) < limit
results.append(allowed)
if allowed:
queue.append(time)
return resultsResponse SHA-256: 8b205b29730d5649cb4214efbd3ac010d06eca51502f88b892cef53c7f40a599
coding-dependencies · repeat 1 · Pass
checked · responded · 2026-10-05T05:44:24.231407+00:00 UTC
Request: req_c58041fcf31f4231943640c6aaf78bd7. Estimated cost: US$0.003022. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
import heapq
def solve(data):
names = set(data)
for prerequisites in data.values():
names.update(prerequisites)
dependents = {name: [] for name in names}
indegree = {name: 0 for name in names}
for job, prerequisites in data.items():
unique_prerequisites = set(prerequisites)
indegree[job] = len(unique_prerequisites)
for prerequisite in unique_prerequisites:
dependents[prerequisite].append(job)
ready = [name for name in names if indegree[name] == 0]
heapq.heapify(ready)
order = []
while ready:
job = heapq.heappop(ready)
order.append(job)
for dependent in dependents[job]:
indegree[dependent] -= 1
if indegree[dependent] == 0:
heapq.heappush(ready, dependent)
return order if len(order) == len(names) else NoneResponse SHA-256: fec7c8d3cf0e4ffa48ea66ced5385d480f50c8b265e297cade2bf8ab9ef80d13
coding-slug · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:37.115699+00:00 UTC
Request: req_55bb1d53ac394459bfa7e83737a65af6. Estimated cost: US$0.001484. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import unicodedata
import re
def solve(data):
normalized = unicodedata.normalize("NFKD", data)
text = "".join(c for c in normalized if not unicodedata.combining(c)).lower()
return re.sub("[^a-z0-9]+", "-", text).strip("-")Response SHA-256: 87120cf5b0988920eb336c9727145da93f47c62cccde24c827478b02cea226db
coding-allocate · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:13.524790+00:00 UTC
Request: req_8db017448b31437abf8a3cd7f369a608. Estimated cost: US$0.002124. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
total = data["total"]
weights = data["weights"]
weight_sum = sum(weights)
if not weights:
return []
if weight_sum == 0:
return [0 for _ in weights]
shares = [divmod(total * weight, weight_sum) for weight in weights]
result = [share[0] for share in shares]
leftover = total - sum(result)
order = sorted(range(len(weights)), key=lambda i: (-shares[i][1], i))
for i in order[:leftover]:
result[i] += 1
return resultResponse SHA-256: f2908fa162552691fffb846c5fe7f6347138fe70b50932d528c45d4efe996156
coding-rate · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:54.917963+00:00 UTC
Request: req_ac71ec3141f54d2aa7ed6172b99493b6. Estimated cost: US$0.002098. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import deque
def solve(data):
limit = data["limit"]
window = data["window"]
accepted = {}
result = []
for event in data["events"]:
user = event["user"]
time = event["time"]
if user not in accepted:
accepted[user] = deque()
times = accepted[user]
cutoff = time - window
while times and times[0] <= cutoff:
times.popleft()
allowed = len(times) < limit
result.append(allowed)
if allowed:
times.append(time)
return resultResponse SHA-256: 1563a9556559b9b0708a333c67f0c9a925b8cfd72301ea10070277d686c19cc7
coding-dedup · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:03.851012+00:00 UTC
Request: req_38039d45a22d4f2eb4a3db6312d7f9f2. Estimated cost: US$0.001438. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
retained = {}
for item in data:
key = item["id"]
if key not in retained or item["version"] >= retained[key]["version"]:
retained[key] = item
return [dict(retained[key]) for key in sorted(retained)]Response SHA-256: 7f7cc9754f691c776533b7dcb9f8f89a73ff900bb5dffcade44fef3fae45c429
coding-dedup · repeat 2 · Pass
checked · responded · 2026-10-05T05:50:07.358701+00:00 UTC
Request: req_c884eef38a0440f5a94b301c5beb1e8a. Estimated cost: US$0.001488. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
retained = {}
for item in data:
item_id = item["id"]
if item_id not in retained or item["version"] >= retained[item_id]["version"]:
retained[item_id] = item
return [retained[item_id] for item_id in sorted(retained)]
Response SHA-256: c751b49aa77250cde34cab7b0e5b08dd9ac32d53767267aa5a3303badf9ebe6d
coding-fifo · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:28.242460+00:00 UTC
Request: req_4f23a6827d7b4f29a8ee4916d5c5d16d. Estimated cost: US$0.002152. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
unsold_demand = data["sold"]
remaining_units = 0
remaining_value_cents = 0
for quantity, unit_cents in data["lots"]:
sold_from_lot = min(quantity, unsold_demand)
unsold_demand -= sold_from_lot
remaining = quantity - sold_from_lot
remaining_units += remaining
remaining_value_cents += remaining * unit_cents
return {
"remaining_units": remaining_units,
"remaining_value_cents": remaining_value_cents,
"unfilled_units": unsold_demand
}Response SHA-256: bb3e4bb46b40f68820164cebed5551c1e28aff767157a503d7729f6f8dcc9c70
coding-csv · repeat 3 · Pass
checked · responded · 2026-10-05T05:52:21.807149+00:00 UTC
Request: req_ae8c2346d43a45008be6e19917432e1d. Estimated cost: US$0.002182. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
def solve(data):
totals = {}
pattern = re.compile(r"[+-]?[0-9]+")
rows = csv.reader(io.StringIO(data))
next(rows, None)
for row in rows:
if len(row) != 2:
continue
customer, cents = row
if not customer.strip():
continue
cents = cents.strip()
if pattern.fullmatch(cents) is None:
continue
totals[customer] = totals.get(customer, 0) + int(cents)
return totalsResponse SHA-256: aefa984e1874321eff6f3709eaa0ae1924f1c615466331b89d30f6e9a0bb6b3f
coding-dependencies · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:44.253053+00:00 UTC
Request: req_f180145e5f9f4a08b1987b37984bc50f. Estimated cost: US$0.002922. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
import heapq
def solve(data):
names = set(data)
for prerequisites in data.values():
names.update(prerequisites)
indegree = {name: 0 for name in names}
dependents = {name: [] for name in names}
for job, prerequisites in data.items():
unique = set(prerequisites)
indegree[job] = len(unique)
for prerequisite in unique:
dependents[prerequisite].append(job)
ready = [name for name in names if indegree[name] == 0]
heapq.heapify(ready)
order = []
while ready:
name = heapq.heappop(ready)
order.append(name)
for job in dependents[name]:
indegree[job] -= 1
if indegree[job] == 0:
heapq.heappush(ready, job)
return order if len(order) == len(names) else NoneResponse SHA-256: 3dba27ae86ac9c6c1307dbea1694955bf117f33a210f8e27b53e43e23b9ffcdd
coding-reconcile · repeat 3 · Pass
checked · responded · 2026-10-05T05:52:02.914231+00:00 UTC
Request: req_5d01eefc435a49bd8c72917dce0ff33d. Estimated cost: US$0.001834. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
def solve(data):
balances = {}
for invoice in data["invoices"]:
key = invoice["id"]
balances[key] = balances.get(key, 0) + invoice["cents"]
for payment in data["payments"]:
key = payment["id"]
balances[key] = balances.get(key, 0) - payment["cents"]
return {key: balances[key] for key in sorted(balances) if balances[key] != 0}Response SHA-256: b61ebebad9f9365d6ae5e9421d00b29fc4bdff06042aa43950954082bb34c23a
coding-slug · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:11.909845+00:00 UTC
Request: req_f90682d62dfb415391159c3705367374. Estimated cost: US$0.001484. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import unicodedata
import re
def solve(data):
normalized = unicodedata.normalize("NFKD", data)
text = "".join(c for c in normalized if not unicodedata.combining(c)).lower()
return re.sub("[^a-z0-9]+", "-", text).strip("-")Response SHA-256: 9c166126cda1f0fef1ece6256d2ebffa2a6a854cf3843e7546b39127a7922350
coding-dependencies · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:50.974018+00:00 UTC
Request: req_db46e496eafd422db1a5b4c86b622898. Estimated cost: US$0.002922. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
import heapq
def solve(data):
names = set(data)
for prerequisites in data.values():
names.update(prerequisites)
indegree = {name: 0 for name in names}
dependents = {name: [] for name in names}
for job, prerequisites in data.items():
unique = set(prerequisites)
indegree[job] = len(unique)
for prerequisite in unique:
dependents[prerequisite].append(job)
ready = [name for name in names if indegree[name] == 0]
heapq.heapify(ready)
order = []
while ready:
name = heapq.heappop(ready)
order.append(name)
for job in dependents[name]:
indegree[job] -= 1
if indegree[job] == 0:
heapq.heappush(ready, job)
return order if len(order) == len(names) else NoneResponse SHA-256: 4f409ec9b683aacc8b5d2f8799fd0a4a231b2f0ea4fb34c1c50ea1ad60ac87e3