munch2024 / munch

2 stars 11 forks source link

Lines of code for 2870 are confusing #81

Closed noodaj closed 8 months ago

noodaj commented 8 months ago

Some of the lines in the code for 2870.py are confusing to read and can be rewritten differently so that it is easier for the reader. This was from the PR #79 where ChatGPT gave a solution to the problem.

The code snippet below shows the complex part of the code that I think can be removed but still allow the solution to be accepted.

if any(count == 1 for count in frequency.values()):
      return -1