Skip to content
TheChatArchiveThe Chat Archive
grok-4-0709· xAIHugging Face LMArena Human Preference 140K

python fib function one line amortized constant runtime linear memory

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with DeepSeekdeepseek-v3-0324’s answer.
  1. User

    python fib function one line amortized constant runtime linear memory

  2. Assistant
    def fib(n, _cache={0:0,1:1}): return _cache[n] if n in _cache else _cache.setdefault(n, fib(n-1) + fib(n-2))
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.