Company: Visa_5sep
Difficulty: medium
Smooth Moisture Grid Problem Description You are an agricultural scientist working on precision farming technology. You are given a two-dimensional matrix of integers moistureGrid representing soil moisture levels across a field, with moistureGrid[i][j] containing an integer from 0 to 255 to represent the moisture level of a soil cell at coordinate (i, j) . You are also given a non-negative integer parameter smoothingRadius . Your task is to apply a moisture smoothing effect to the field. To apply a moisture smoothing effect to the field, replace the moisture level of each soil cell (i, j) with the average value of its original moisture level moistureGrid[i][j] and the mean moisture level of its neighboring cells (defined as neighbors(i, j) ). Soil cell (k, l) is included in neighbors(i, j) if it satisfies the conditions abs(i - k) and abs(j - l) . Expand to see the example field layouts. The neighbors of soil cell at coordinate (2, 2) for smoothingRadius = 1 : The neighbors of soil ce