Skip to content

15.3 Python GeneratePermutation bug in tests when submitting wrong solution #248

@pp5x

Description

@pp5x

What?

On exercise of 15.3 GeneratePermutation page 230 the solution code and EPIJudge are reversing the swap in the for loop.

I managed to pass the tests without that second swap by generating this list instead:

[[0, 1, 2], [0, 2, 1], [2, 0, 1], [2, 1, 0], [0, 1, 2], [0, 2, 1]]

There must be an issue in the functions checking the list content as there are duplicated results.

How?

Delete the second swap and see all the tests passing.

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