Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order dependent answer checkers. #3

Open
Covariance opened this issue Dec 1, 2020 · 1 comment
Open

Order dependent answer checkers. #3

Covariance opened this issue Dec 1, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Covariance
Copy link

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.

@Covariance Covariance added the bug Something isn't working label Dec 1, 2020
@Shemplo
Copy link
Owner

Shemplo commented Dec 1, 2020

Actually yes, it's bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants