Example 1 · missing
| Call | Returns |
|---|---|
NewCache(2) | Instance 1 |
instance1.Get("x") | Missing (found = false) |
Test data
- Input
{"capacity":2,"ops":[["get","x"]]}- Expected output
[null]
func NewCache(capacity int) *Cachefunc (c *Cache) Get(key string) (string, bool)func (c *Cache) Put(key, value string)The runner calls your functions directly; you do not need to parse JSON.
| Call | Returns |
|---|---|
NewCache(2) | Instance 1 |
instance1.Get("x") | Missing (found = false) |
{"capacity":2,"ops":[["get","x"]]}[null]
| Call | Returns |
|---|---|
NewCache(2) | Instance 1 |
instance1.Put("A", "1") | No return value |
instance1.Get("A") | "1" |
instance1.Put("A", "2") | No return value |
instance1.Get("A") | "2" |
{"capacity":2,"ops":[["put","A","1"],["get","A"],["put","A","2"],["get","A"]]}[null,"1",null,"2"]
Checking execution availability…
View inputs and expected outputs. Examples do not run your code.