Trace of a matrix
CodeChefOpen on judge ↗
Given a 2D-Square matrix of order *N*, Find the trace of the matrix ### Input - The first line consists the order of the square matrix *N*. - Next *N* lines represents each row of the matrix , each line contains of *N* values. ### Output Output the Trace of the square matrix ### Constraints - $1 \leq N \leq 1000$ - The output is guaranteed to be less than (2^31) -1 ### Subtasks - **Subtask 1 (
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start