Company: Mercer | Mettl_13oct
Difficulty: medium
Inverted Triangles Problem Description John is a tailor who is trying to design a T-shirt by placing diamond-shaped pieces of fabric in a pattern of inverted right-angled triangles. He has marked places where the diamonds will be placed on the T-shirt but has difficulty counting the number of inverted right-angled triangles in it. The T-shirt design is given as a matrix A which has only the integers 0 (no diamond) or 1 (one diamond) as its elements. You need to help John find and return an integer value representing the number of inverted right-angled triangles that will come up in the T-shirt. Input Specification: input1: An integer value representing the number of rows in the Matrix A. input2: An integer value representing the number of columns in the Matrix A. input3: An integer matrix A of size input1 x input2 representing the design of the T-shirt, where A[i][j] represents the contents of the i th row and the j th column in the input Matrix A. Output Specification: Return an integ