Ambiguity here?


  • 0
    K

    [ [1,2], [3,4] ] can be interpreted as

    1 2
    3 4
    

    or

    3 4
    1 2
    

    or ...

    Suppose matrix is indexed with matrix[x][y],

    If x+ to y+ is CCW, the pixel transform is (x,y) -> (y,n-1-x) for a 90 degree CW rotation of image (which is the assumption in judgment);

    otherwise the pixel transform is (x,y) -> (n-1-y, x) for the same image rotation.

    So I think the problem should specify the directions of axes since in image area x->y is usually CW.


  • 0
    K

    OK I'm new here. Seems [ [1,2], [3,4] ] is interpreted as

    12
    34
    

    by default. Never mind.


Log in to reply
 

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