Wpis z mikrobloga

odświeżam sobie analityczne myslenie przed rozmowa o prace i robie zadanka na hackerranku i nie moge dojsc dlaczego moje rozwiazanie za nic nie chce przejsc.

Given a square matrix, calculate the absolute difference between the sums of its diagonals.

Sample Input
3
11 2 4
4 5 6
10 8 -12

to moja funkcja, nie mam zielonego pojecia dlaczego to nie chce przejsc testow

#csharp #programowanie
napalonykrzysztof - odświeżam sobie analityczne myslenie przed rozmowa o prace i robi...

źródło: comment_1611096049K9AbafxfTfpWtlWRlCKPca.jpg

Pobierz
  • 14
@rzulw: Input Format

The first line contains a single integer, , the number of rows and columns in the square matrix .
Each of the next lines describes a row, , and consists of space-separated integers .
Dlatego biore arr[0][0] jako wielkosc macierzy
@rzulw: zrobilem taka liste lokalnie w visual studio i pieknie wypluwa rozwiazanie w konsolowej apce, szukalem na internecie i jak sie okazlao moje rozwiazanie jest bardziej optymalne bo korzysta z jednej petli. Tylko jakims cudem nie przechodzi testow
@rzulw: @zibizz1: cytat z dyskusji w zadaniu ktora dopiero teraz zauwazylem ze moge czytac przed wyslaniem:
Hey, my buddy, I was struggling with the same error, and finally, I figured it out, the array for C++/C# does not contain the first line, that is, we have to get the matrix size from the number of elements of arr.

Wszystko jasne, dziękuje koliegowie. Życzcie mi 8k w przyszlym tygodniu XD