Test Cases & Chat
Part 1
current
Test 1
input:Killer: expired grants must still absorb earlier subtracts; create A(10,exp50), B(10,exp100), subtract(40,8), getBalance(50)→10
expect:[12, 10, 7, 0]
Test 2
input:Out-of-order + overdraw: subtract(10,8) arrives before grant; later subtract(15,20) overdraws to 0
expect:[0, 10, 2, 0]
Test 3
input:Same timestamp: createGrant(t=5) then subtract(t=5) is allowed
expect:[0, 7]
Test 4
input:Duplicate grantId ignored; invalid grant (t>=exp) never valid
expect:[2, 0]
Part 2
locked
Resume a session
Loading sessions...
or start fresh
Choose your coach
Pick a style and how you want to communicate
then
Loading...
OUTPUT
Run code to see output...
Part 1
current
Test 1
input:Killer: expired grants must still absorb earlier subtracts; create A(10,exp50), B(10,exp100), subtract(40,8), getBalance(50)→10
expect:[12, 10, 7, 0]
Test 2
input:Out-of-order + overdraw: subtract(10,8) arrives before grant; later subtract(15,20) overdraws to 0
expect:[0, 10, 2, 0]
Test 3
input:Same timestamp: createGrant(t=5) then subtract(t=5) is allowed
expect:[0, 7]
Test 4
input:Duplicate grantId ignored; invalid grant (t>=exp) never valid
expect:[2, 0]
Part 2
locked
Resume a session
Loading sessions...
or start fresh
Choose your coach
Pick a style and how you want to communicate
then