Developer-Student-Clubs-VSSUT-Burla / Master-PyAlgo

36 stars 84 forks source link

Hourglass Sum #468

Closed Manasi2001 closed 3 years ago

Manasi2001 commented 3 years ago

I've added the complete program with proper comments, example and explanations. @rcoder23 please check out this PR with reference to issue #467.

Manasi2001 commented 3 years ago

On running the program it give unexpected EOF while parsing error in my computer Recheck and correct code.

It's working absolutely fine in mine @rcoder23. image

rcoder23 commented 3 years ago

@Manasi2001 For test case 0 3 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 2 4 4 0 0 0 2 4

it give output 12 but correct 11 .

rcoder23 commented 3 years ago

Screenshot (67)

rcoder23 commented 3 years ago

https://www.geeksforgeeks.org/maximum-sum-hour-glass-matrix/

check this.

Manasi2001 commented 3 years ago

@Manasi2001 For test case 0 3 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 2 4 4 0 0 0 2 4

it give output 12 but correct 11 .

@rcoder23 you're getting this error because you're entering a 5 X 5 matrix, whereas my code is built for a 6 X 6 array. image The code's link that you shared is also meant for a 5 X 5 matrix. If you'll enter any matrix with apt size, it'll give you the correct answer :)

rcoder23 commented 3 years ago

@Manasi2001 My mistake