I have a problem with making fuction to find a number in 2d array to edit numbers in main diagonal to 1 and add this number to all numbers in the line. Like 2d array is: