Given a data matrix X whose rows are samples and whose columns are features, compute the Gram matrix X⊤X of its columns.
Implement solve(X).
Returns. Return a symmetric NumPy array of shape (d,d) for d columns.
Example 1
Input:
solve([[1.0, 2.0], [3.0, 4.0]])
Output:
[[10.0, 14.0], [14.0, 20.0]]
Example 2
Input:
solve([[1.0, 0.0], [0.0, 1.0]])
Output:
[[1.0, 0.0], [0.0, 1.0]]
No results yet
Run your code to check it against the examples, or submit to run every test.