Company: IBM_19nov
Difficulty: medium
Number of Ways to Choose Cables Problem Description There is a box of ethernet cables arranged in a grid of dimensions rows x columns. Given a list of queries in the form [rows, columns], return a list where for each query, it contains the sum of the number of ways to select a square/rectangle valid value of a, where 1 <= a <= min(rows, columns). For example, if rows = 6 and columns = 3: - There are 3 * 6 = 18 ways to choose a 1 x 1 area of cables. - There are 2 * 4 = 8 ways to choose a 2 x 2 area of cables. - There are 1 * 3 = 3 ways to choose a 3 x 3 area of cables. - There is no way to choose an area larger than 3 x 3. In total, there are 18 + 8 + 3 = 26 ways the box can be divided. There is only one query, so return [26]. Function Description Complete the function numberOfWays in the editor with the following parameter(s): - int[][] queries: A 2D array of integers, each represents box dimensions (rows x columns) for a query. Returns - long_int[]: An array of long integers where ele