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 - count characters in string #110

Closed
7 tasks done
hobovsky opened this issue Aug 8, 2022 · 8 comments
Closed
7 tasks done

Deduplicate - count characters in string #110

hobovsky opened this issue Aug 8, 2022 · 8 comments
Assignees
Labels
discussion/deduplicate Discussion and vote what to do with duplicate kata

Comments

@hobovsky
Copy link
Contributor

hobovsky commented Aug 8, 2022

In Python, most of the kata can be solved with a mere from collections import Counter as solution.

  1. String Letter Counting
  • 6kyu, but beta votes were pointing towards 7 kyu
  • result is a formatted string
  • 93% with 2.5k completions
  • 1 pending issue
  • 4 languages, 2 pending translations
  • Published Oct 2017, author inactive
  1. Count letters in string
  • 6kyu, but votes were pointing at 7 kyu
  • Can be solved by aliasing Counter
  • 91% with ~4.8k completions
  • 1 pending issue about being a duplicate
  • 4 languages, 2 pending translations
  • Published Oct 2016, author inactive
  1. Count characters in your string
  • 6kyu
  • Can be solved by aliasing Counter
  • 90% with 47k completions
  • 2 pending issues
  • 8 languages, 1 pending translation
  • Published Feb 2014, author inactive
  1. Character frequency
  • 6kyu
  • case-insensitive, filtered, output is a sorted list of tuples
  • 93% with 2.5k completions
  • 4 pending issues
  • 6 languages, 1 pending translation
  • Published Aug 2014, author inactive
  1. Ordered Count of Characters
  • 7kyu
  • Output is a list of tuples in order of appearance, case sensitive
  • 91% with ~8.5k completions
  • 1 pending issue
  • 18 languages + 1 pending translation
  • Published Aug 2016, author active
  1. Occurrences in a string
  • 7kyu
  • 86% with 170+ completions
  • 1 pending issue
  • 1 approved language (CoffeeScript only), 1 pending translation (JavaScript)
  • Published Nov 2015, author last active Apr 2022
  1. Character Frequency
  • 8kyu
  • Can be solved by aliasing Counter
  • 93% with 5.9k solutions
  • No pending issues
  • 3 languages, no pending translations
  • Published Dec 2014, author inactive
  1. Counting Array Elements
  • 7kyu
  • Counts not characters in a string, but strings in an array. Can be solved by aliasing Counter.
  • 94% with ~6.7k completions
  • No pending issues
  • 4 approved languages, no pending translations
  • Published May 2015, author inactive

Languages:

image

A - approved translation
P - pending translation


Conclusion

Filling gaps

  • Move COBOL pending translation from 2. to 3. or 5.
@hobovsky hobovsky added the discussion/deduplicate Discussion and vote what to do with duplicate kata label Aug 8, 2022
@ejini6969
Copy link

ejini6969 commented Aug 8, 2022

Keep 3rd

Retire

2nd (due to being same rank as 3. & dup of 3.)
6th (due to CS only and dup of 3. with extra lowercase conversion)
7th (due to being under-ranked & dup of 3.)
8th (due to less languages & dup of 3.)

I think among 1st, 4th, 5th, we can choose one to keep but not sure how to decide for now... (IMO the rank should be same as 3rd. since those 3 asked for additional tasks such as filtering, sorting, convert to array of arrays etc., but 5th has the highest number of languages and completions thoo it's 7kyu...)

EDIT: Due to 5th having an interesting output type and has highest completion, keep it!!!

@akar-0
Copy link

akar-0 commented Aug 8, 2022

Just a note to say about 5 (I've translated recently to D): I think the difference of returning an ordeedr list of tuples make the task sufficiently different from others. For a basic kata, I think this is an interesting and pertinent variation that worths to be conserved.

I think it would be good to conserve this one and probably another expecting a hash, I'll examine it better later and will vote in consequence.

@Kacarott
Copy link

Kacarott commented Aug 8, 2022

Keep number 5, retire the rest.

@suic86
Copy link

suic86 commented Aug 8, 2022

Backstory of no. 5: The reason for creating the kata was to show a pattern (aka clever hack) which was relevant before 3.6. This is way easier to solve now than it was at the time it was published due the new dict implementation in Python 3.6 (see here).

I also agree with @akar-0 that it's different enough from the others to keep it. However, is not that different as it was at the time of creation.

IMO this type of kata is 7kyu.

@hobovsky
Copy link
Contributor Author

hobovsky commented Aug 8, 2022

Just to be clear, I am aware how handling appearance order can be an additional challenge, and it actually still is, in many languages. Order of maps and dictionaries is often an implementation detail, and maintaining it can be challenging in languages other than Python. Reviewers should take this into account while choosing candidates for deduplication. If the requirement of the order is properly enforced and tested (i.e. not just with actualDict == expectedDict, which ignores the order), then it's indeed an interesting twist. Java would require some particular implementation of a Map, and as far as I know, C# does not support insertion order out of the box? so it would have to be enforced explicitly.

@EloiseRosen
Copy link

vote for keep 5, retire the others

@fcr--
Copy link

fcr-- commented Aug 21, 2022

I would keep 3 and 5, and retire the rest.

@hobovsky
Copy link
Contributor Author

Everyone seems to agree to keep 5., so it will stay.
There are two votes to keep 3., that's why I think it would be worth keeping.
No other kata got a vote to stay, I will ask for retirement.

@kazk kazk removed their assignment Sep 13, 2022
@kazk kazk closed this as completed Sep 16, 2022
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

8 participants