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

fix: shuffleArray returns the same array #38

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

motinados
Copy link
Owner

The shuffleArray function sometimes returns the same array even after shuffling.
This pull request fixes this issue.
However, if the array has only one element, it returns the original array.
Also, if all elements in the array are the same, it returns the original array.
In other cases, it loops until the shuffled array is different from the original array.
To be safe, a maximum number of attempts is set.

@motinados motinados merged commit 444202a into main Aug 3, 2024
2 checks passed
@motinados motinados deleted the fix/shuffleArray-returns-the-same-array branch August 3, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant