American Express | Online Screening Grad 2019 | Consecutive Product

Given two integers A and B, return the number of integers from the range [A,,,B] inclusive that can be expressed as the product of two consecutive integers.
e.g.
Given A = 6, B = 20, return 3.
Because 2* 3 = 6, 3* 4 = 12, and 4*5 = 20.

Comments (4)