Please update the function's declaration


  • 2
    X
    public class Solution {
          public int minArea(char[][] image, int x, int y) {
          }
    }
    

    x and y are really confusing here, could admin update those to row and col? Because row actually is "y" and col actually is "x". I think the declaration below is much clear.

    public class Solution {
          public int minArea(char[][] image, int row, int col) {
          }  
    }

  • 0

    row actually is "y" and col actually is "x"

    No, the row is "x" and the column is "y".

    But I agree that that's rather unusual and thus confusing. I also said that myself about an earlier problem but got rejected.

    I think the names should be "x" and "y" because that's what coordinates are typically called when talking about images. I just wish they'd be used in the normal way. But changing that at this point would invalidate all solutions, so I agree with your suggestion of using "row" and "col".


  • 0

    If we only need to find the range of all '1' then x and y are not necessary. Simply going through all '1's while checking the min and max of rows and cols is enough.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.