codewars / content-issues

Higher level issue tracker for the Codewars content.
15 stars 1 forks source link

Deduplicate - Largest / smallest product of n consecutive numbers #177

Open hobovsky opened 1 year ago

hobovsky commented 1 year ago

From #39

  1. Largest product in a series

    • 5kyu
    • Input is always sufficiently long. Result is a largest product.
    • Satisfaction 90% with 2.3k completions
    • No pending issues
    • 4 languages + 2 pending translations
    • Published Nov 2013, author inactive
  2. Lowest product of 4 consecutive numbers

    • 6kyu
    • Input can be not sufficiently long. Result is a smallest product.
    • Satisfaction 91% with 1.6k completions
    • No pending issues
    • 3 languages, no pending translations, all covered by 1.
    • Published May 2015, author inactive.
hobovsky commented 1 year ago

Kata 1. would be a very good candidate to keep if not its high rank of 5 kyu. Kata 2. is worse than 1. for a couple of reasons. While too small inputs are OK and can be modelled with some Option type (depending on language), the mixed output types, and smaller amount of languages can make it less attractive to keep. But still, effort needed to bring it to acceptable level would not be very high.

Possible ways are: keep 1. as technically better but overranked, or keep 2. as better ranked and fix (remove mixed output types, and transfer 3 languages). I am fine with both.

ejini6969 commented 1 year ago

I vote to keep 1 as it requires less maintenance and need not to invalidate existing solutions. Plus, reranking can be done in future if the bug is somehow fixed soon.

Blind4Basics commented 1 year ago

(there is no "bug" about reranking, it's just technically heavy on the resources. It's doubtful it' becomes otherwise in the future)

I'd keep 2 and fix the languages. Even 2 is overranked, considering current standards. 'opt for Johan's alternative.

JohanWiltink commented 1 year ago

Keep 1, retire 2.

Reranking 1 is a different issue, but 2 just sucks.

Alternatively: retire both and make a new one. Asking for lowest product allows optimisation when encountering 0. Maybe even make inputs possibly infinite ( specify that infinite inputs will have a 0 at a finite index ).

hobovsky commented 1 year ago

For now, I think we can retire 2. and keep 1.
Since many users liked Johan's idea of replacing 1. with a new kata with an additional twist, I will create a follow-up ticket. It would be great if someone helped to create a new kata as described by Johan, preferably in some popular language, and either publish as their own, or pass the code to me if they don't want to be listed as its author.

JohanWiltink commented 1 year ago

I started designing a replacement.

Making inputs possibly infinite requires using generators instead of strings in JS and Python, which makes for a wholly different kata. Requiring optimisation is also near impossible - generating huge inputs takes more time than chewing through them without optimisation; multiplication is not expensive enough.

Creating a new, better version is not trivial.