Skip to content

Conversation

@leticialunaz
Copy link

Changes:

Replaced the guessed list with a set() for O(1) lookups and prevention of duplicate letters.

Updated the game loop to only register a guess if it hasn’t been guessed before.

Modified spacedOut to efficiently display letters using the set.

Benefits:

Complexity reduced from O(n*k) to O(n).

Execution time drops significantly in benchmarks, improving overall game performance.

Prevents repeated penalties for the same incorrect guess.

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