How can I check if a diagonal element in 2D array is occupied?

I’m trying to complete the nQueens puzzle problem with a 2D array. I’m having trouble checking to see if an element diagonal to the current element is occupied? I tried doing another for loop, but it …