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

Deduplicate - Summation #188

Closed
1 task done
hobovsky opened this issue Apr 27, 2023 · 6 comments
Closed
1 task done

Deduplicate - Summation #188

hobovsky opened this issue Apr 27, 2023 · 6 comments
Assignees
Labels
discussion/deduplicate Discussion and vote what to do with duplicate kata

Comments

@hobovsky
Copy link
Contributor

hobovsky commented Apr 27, 2023

From #39

  1. Grasshopper - Summation
  • 8kyu
  • Allows O(n) solutions
  • Satisfaction 91% with 180k+ completions
  • 1 pending issue
  • 52 languages, no pending translations
  • Published Aug 2015, author inactive
  1. Gauß needs help! (Sums of a lot of numbers).
  • 7kyu
  • Allows O(n) solutions. Feeds all type of rubbish as input.
  • Satisfaction 84% with 13k+ completions
  • 5 pending issues
  • 7 languages + 1 pending translation
  • Published Feb 2015, author inactive
  1. Triangular Treasure
  • 7kyu
  • Task mentions "triangular numbers" rather than "sum of numbers from 1 to n". Seems to require O(1) solutions. Return 0 for negative inputs.
  • Satisfaction 85% with 24k completions
  • 2 pending issues
  • 17 languages + 1 pending translation
  • Published Oct 2013, author active.

Conclusion

@hobovsky
Copy link
Contributor Author

I think that kata 1. is good to keep because it has a large coverage of languages and good difficulty.

I think kata 3. would be good to keep if it enforced O(1) solutions. The "sum numbers 1 to n" and "triangular numbers" might be not obviously related for total newbies, and I think that spoilers posted into kata 1. are not that relevant on this level. My proposal is to review all languages, make sure that all require O(1) solutions, harden or mark for removal these which do not, and keep the kata.

Kata 2. is the worst of the three: it's a blatant duplicate with a lot of annoying things like invalid inputs. Its description might be considered interesting, but even with the description, I think the kata is not worth keeping.

@hobovsky hobovsky added the discussion/deduplicate Discussion and vote what to do with duplicate kata label Apr 27, 2023
@monadius
Copy link

Languages of kata 3 which allow O(n) solutions:

  • C
  • COBOL
  • CoffeeScript
  • C# (no random tests)
  • Dart
  • Haskell
  • Java
  • JavaScript
  • Julia
  • NASM
  • Ruby
  • Rust
  • SQL (O(n) solutions are more difficult than O(1) solutions)
  • Swift (no random tests)

It will be easy to fix all these languages by increasing the upper bound of tested numbers.

@JulianNicholls
Copy link

Obviously, I'm biased since I am the author of Kata 3, but I will throw my vote in for it anyway.

When I wrote it (10 years ago), it was not possible to use an O(n) solution in the three original languages, but computers have moved on and an O(n) solution finishes before the timeout. As @monadius says, it would be simple to increase the upper bound to exclude the O(n) solutions.

@hobovsky
Copy link
Contributor Author

Hi, and thanks for sharing your point of view!

The question now would be, would you be willing to go through languages of your kata and change tests in a way only O(1) solutions are accepted? Or, if its too much work for you, would you let users provide appropriate forks, and would you approve them?

@CiprianAmza
Copy link

I would say to keep 1 + 3. Having only O(1) solutions for the 3rd kata would be also interesting (right now O(n) passes the tests).

@hobovsky
Copy link
Contributor Author

Created a follow-up issue to harden tests of Triangular Treasure: #194

@kazk kazk closed this as completed Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion/deduplicate Discussion and vote what to do with duplicate kata
Projects
Development

No branches or pull requests

5 participants