Help me in implementing. Simple implementation [unable to implement :( ]

Правка en1, от Boring_Day, 2023-04-13 20:25:50

Lets say you have a matrix. Write a function which takes cell points and a number k. (It returns sum from rows).

for ex: func(i, j, k) here i and j are cell position. And k is a number. // I want sum from continuous rows.

I want sum from mat[i][j-k] to mat[i][j+k] + sum from mat[i-1][j-(k-1)] to mat[i-1][j+(k-1)] + sum from mat[i-2][j-(k-2)] to mat[i-2][j+(k-2)] and so on. If you go out of border add zero (do nothing).

Help me please Tell me if i clearly explai the problem or not.

Теги implementation, basics, easy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Boring_Day 2023-04-13 20:25:50 573 Initial revision (published)