Explanation

517.Perform the Five Basic Arithmetic Operations

Easy
Given two integers a and b (with b at least 1), return five results in order: a + b, a - b, a × b, the whole-number quotient of a ÷ b, and the remainder. These five operators are the building blocks of almost every program. Addition, subtraction and multiplication behave the way you expect. Division between whole numbers is the one to watch: integer divisionInteger DivisionDividing two whole numbers and keeping only the whole part of the answer, e.g. 17 / 5 = 3. keeps only how many whole times b fits, and the modulo operatorModulo (%)Gives the remainder left after integer division, e.g. 17 % 5 = 2. reports what is left over. The second solution shows that the two are tied together: the remainder can be rebuilt from the quotient.

Example 1:

Input: a = 17, b = 5

Output: [22,12,85,3,2]

Example 2:

Input: a = 4, b = 9

Output: [13,-5,36,0,4]

+ 5 hidden test cases run on Submit.

Constraints:

  • ●0 ≤ a ≤ 10000
  • ●1 ≤ b ≤ 10000

a =

17

b =

5