← Wells Fargo questions

Add diagonal elements of NxN matrix

Filed under Wells Fargo

Given an N x N square matrix, calculate the sum of the primary diagonal (top-left to bottom-right) and the secondary diagonal (top-right to bottom-left).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Wells Fargo questions

Collected from public candidate posts and coding forums. Updated Nov 2026.