Let's take an upper triangular matrix for proper visualization :-
$a_{11} \ a_{12} \ ............ a_{1n}$
$0 \ \ \ \ a_{22} \ .............a_{2n}$
.
.
.
$0 \ \ \ \ 0..........................a_{nn}$
What would be the determinant of this matrix ?
One observation , if we see the last row of the matrix , only one element is non-zero , others are 0 , thus anyway they're contributing 0 to the final determinant ,
Thus the determinant will be $a_{nn}*A[n-1][n-1]$.
In $A[n-1][n-1]$ it can be observed that , last row in $A[n-1][n-1]$ has only $a_{n-1n-1}$ as non-zero , others are 0 , so they'll only contribute 0 to the final determinant .
Thus $det(A) = a_{nn}*a_{n-1n-1}A[n-2][n-2]$.
Thus we can see a recursive behavior here.
Thus the determinant can be written as ,
$det(A) = a_{nn}*a_{n-1n-1}*.......a_{11}$.
which is nothing but product of the diagonal elements of the array.
how can this be found?
$for(i=1;i<=n;i++)\{\\det*=A[i][i];\\\}$.
This has a complexity of $\Theta(n)$