JavaScript:实现以递归的形式MatrixExponentiation矩阵求幂算法
/*
Complexity:
O(d^3 log n)
where: d is the dimension of the square matrix
n is the power the matrix is raised to
*/
const Identity = (n) => {
// Input: n: int
// Output: res: Identity matrix of size n x n
// Complexity: O(n^2)