Rectangle Area

Given separate width and height values measured in the same integer length unit, return the rectangle's area in square units. Multiply the two dimensions.

Given separate width and height values measured in the same integer length unit, return the rectangle's area in square units. Multiply the two dimensions.

Width and height are exact positive integers from 1 through 46,340. Zero, negative, Boolean, floating-point and string values are invalid. The area fits a signed 32-bit integer.

Example 1: input width = 2, height = 3; output 6. A width of 2 repeated across 3 rows gives an area of 6 square units.

Example 2: input width = 4, height = 7; output 28. Multiply the two side lengths to find 28 square units.

Example 3: input width = 7, height = 4; output 28. Swapping the side lengths preserves the same area.

Category: Math & Numbers. Topic: math. Difficulty: Easy. Patterns: math.