Geeksforgeeks

Error

Find total number of Rectangles (excluding squares) in a **N*N** chessboard.

**Example 1:**

Input:N =1Output:0Explanation:There is only 1 square on a 1*1 chess board. There are no Proper Rectangles.

**Example 2:**

Input:N =2Output:4Explanation:There are 4 rectangles in a 2*2 chessboard.

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **rectanglesInChessBoard()** which takes an Integer N as input and returns the number of rectangles in a N*N chess board.

**Expected Time Complexity:** O(1)

**Expected Auxiliary Space:** O(1)

**Constraints:**

1 <= N <= 10^{5}

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Rectangles in N*N Board

...