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

iter.permutations() generates duplicated combinations #70

Open
sunnylcw opened this issue Dec 11, 2021 · 1 comment
Open

iter.permutations() generates duplicated combinations #70

sunnylcw opened this issue Dec 11, 2021 · 1 comment
Labels
good first issue Good for newcomers Hacktoberfest This label is assigned to any issue that is good to go for any Hacktoberfest participant

Comments

@sunnylcw
Copy link

VSL version: 0.1.45
OS: Windows 11 Pro 21H2 22000.318

What did you do?
Generated combinations with iter.permutations()

What did you expect to see?
An array of unique combinations

What did you see instead?
An array with some duplicated combinations

Code to reproduce the issue:

import vsl.iter
combinations := iter.permutations([f64(0), 1, 2], 3)
println('combinations: $combinations\n')

// check for duplicates
mut combination_count := map[string]int{}
for combination in combinations {
	combination_count[combination.str()]++
}
println('duplicates:')
for k, v in combination_count {
	if v > 1 {
		println('$k: $v')
	}
}
@ulises-jeremias
Copy link
Member

ulises-jeremias commented Dec 11, 2021

hey! thank for creating this issue! I'll keep you updated with the status of this issue!

@ulises-jeremias ulises-jeremias added the Hacktoberfest This label is assigned to any issue that is good to go for any Hacktoberfest participant label Oct 7, 2022
@ulises-jeremias ulises-jeremias added the good first issue Good for newcomers label Oct 23, 2022
@ulises-jeremias ulises-jeremias removed the Hacktoberfest This label is assigned to any issue that is good to go for any Hacktoberfest participant label Apr 22, 2023
@ulises-jeremias ulises-jeremias added the Hacktoberfest This label is assigned to any issue that is good to go for any Hacktoberfest participant label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest This label is assigned to any issue that is good to go for any Hacktoberfest participant
Projects
None yet
Development

No branches or pull requests

2 participants