Skip to content

Report potential bug #3

@ziyi-zhang-mark

Description

@ziyi-zhang-mark

If we switch the order of these directions, it will not pass the Leetcode test any longer.

char[] dstr = {'u', 'd', 'l', 'r'};
int[][] dirs = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};

While change the order:

char[] dstr = {'d', 'u', 'l', 'r'};
int[][] dirs = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}};

test case failed: [[0,0,0,0,0],[1,1,0,0,1],[0,0,0,0,0],[0,1,0,0,1],[0,1,0,0,0]]
[4,3]
[0,1]
Output "dldul"
Expected "lul"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions