You need to enable JavaScript to run this application 😰
Home
Games
Wordle
Practice Problems
Subtract
MergeSort
Highscores
Settings
This app is only for screens wider than 800px.
Problems
Font-Size
Theme
×
Subtract
Merge Sort
TwoSum
Number of Islands
Subtract
Given two numbers a and b, return a minus b.
Example 1:
Input:
6, 5
Output:
1
Explanation:
Because 6 minus 5 is 1, we return 1.
Example 2:
Input:
-5, -5
Output:
0
Example 3:
Input:
-10, 8
Output:
-18
Notes:
1
2
3
function subtract(a, b) {
// write your code here
}
Run Tests
Reset Code