Browse and switch challenges
JSON Diff

Return a lexicographically sorted list of JSON paths where two JSON-serializable values differ. Paths use '.' for keys and '[i]' for array indices; the root is ''.

Important

  • -Include additions, removals, and value changes.
  • -Arrays are dense 0..n-1; keys are strings.
Signature
Constraints
  • -Total nested nodes ≤ 1e5
  • -Keys are strings, arrays are dense 0..n-1
Examples
    System prompt
    0 tokens
    Read-only
    // Waiting for generated code…
    // Your output will appear here as soon as the model returns JavaScript.
    // It must define function jsondiff(…).
    // Tip: write a prompt on the left and click "Generate code" .
    0 tokens
    Submission #1
    0tokens(0/0)
    Leaderboard
    Loading leaderboard...