Skip to content

probable code correction #1

Description

@mchangir

visited.put(pos, visited.get(element + 1));

Shouldn't the above line instead be: visited.put(pos, visited.get(element) + 1);

Note the placement of the + 1
In your code it is the part of the visited.get() call, whereas I'm suggesting it should be outside the visited.get() call.
Please correct me if I'm mistaken. I'm just trying to make sense of the code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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