Add Two Integers
Given two integers a and b, return a + b. This is a warm-up to verify your environment and function signature are correct. Handle positive and negative integers, including zero. You do not need to worry about floating point numbers or non-numeric inputs; tests only provide valid integers. Input: two integers (e.g., 2 and 3). Output: a single integer equal to their sum (e.g., 5). Examples: - add(2, 3) -> 5 - add(-1, 1) -> 0 - add(0, 0) -> 0 Notes: The operation is commutative and associative; there are no side effects. You should return the computed value directly.
- |a|, |b| ≤ 1e9
Function:
add(…)
0tokens
Read-only
// Waiting for generated code…
// Your output will appear here as soon as the model returns JavaScript.
// It must define function add(…)
.
// Tip: write a prompt on the left and click "Generate code" (⌘⏎).
0tokens
0 tokens (0/0)
Leaderboard
No accepted submissions yet.