Example 1 · missing
| Call | Returns |
|---|---|
NewExpiringStore() | Instance 1 |
instance1.Get("x", 0) | Missing (found = false) |
instance1.Delete("x", 0) | false |
Test data
- Input
{"ops":[["get","x",0],["delete","x",0]]}- Expected output
[null,false]
func NewExpiringStore() *ExpiringStorefunc (s *ExpiringStore) Set(key, value string, ttl, now int64)func (s *ExpiringStore) Get(key string, now int64) (string, bool)func (s *ExpiringStore) Delete(key string, now int64) boolThe runner calls your functions directly; you do not need to parse JSON.
| Call | Returns |
|---|---|
NewExpiringStore() | Instance 1 |
instance1.Get("x", 0) | Missing (found = false) |
instance1.Delete("x", 0) | false |
{"ops":[["get","x",0],["delete","x",0]]}[null,false]
| Call | Returns |
|---|---|
NewExpiringStore() | Instance 1 |
instance1.Set("x", "", 10, 0) | No return value |
instance1.Get("x", 0) | "" |
instance1.Delete("x", 1) | true |
instance1.Get("x", 1) | Missing (found = false) |
instance1.Delete("x", 1) | false |
{"ops":[["set","x","",10,0],["get","x",0],["delete","x",1],["get","x",1],["delete","x",1]]}[null,"",true,null,false]
Loading…
Checking execution availability…
View inputs and expected outputs. Examples do not run your code.