• + 0 comments
    def strangeGrid(r, c):
        # we surely know that if row is even then number is odd and vice versa (row odd = even number )
        if r%2!=0:
            return (math.ceil(r/2)-1)*10+(2*(c-1))
        else:
            return ((math.ceil(r/2)-1)*10 +1) +(2*(c-1))