Multiply Two
Easy · rating 800 · Math
Read two integers a and b. Print their product.
Constraints: |a|, |b| ≤ 109
Editorial
Multiply Two prints the product of two integers. The subtlety is range: two values up to 10⁹ multiply to about 10¹⁸, which needs a 64-bit integer to hold.
print(a * b)Complexity
Time: O(1). Space: O(1).
Related problems
- Absolute Value — Easy
- Change Due — Easy
- Count Digits — Easy
- Even or Odd — Easy
- Sum of Two — Easy
- Array Sum — Easy