Skip to content

Order dependent answer checkers. #3

@Covariance

Description

@Covariance

Description:

Task 2 states that List<String> of unique names must be returned, but ordering is not specified.

The issue can be replicated by taking the right solution:

    public List <String> task2 (List <String> names) {
        List<String> result = new ArrayList<>(List.copyOf(Set.copyOf(names)));
        return result;
    }

Which passes the tests and then applying Collections.shuffle() to it, like this:

    public List <String> task2 (List <String> names) {
        var result = new ArrayList<>(List.copyOf(Set.copyOf(names)));
        Collections.shuffle(result);
        return result;
    }

The resulting solution must pass tests according to the statement, but it doesn't.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions