Retired

Character Frequency Finder (retired)

Description:

Your mission, should you choose to accept it, is to create a function that uncovers the secrets hidden in plain sight! Your task is to implement the find_similar function. This function takes two parameters:

  • string: A mysterious string that may contain repeated characters.
  • number: The minimum number of times a character must appear to be considered significant.

The function should return a list of all characters that appear at least number times in the given string. But beware, there are some twists:

  • The function should be case-insensitive in counting, but case-preserving in output. 'A' and 'a' are considered the same character for counting purposes, but the first occurrence's case should be preserved in the output.
  • Each character should only appear once in the returned list, even if it occurs more than number times.
  • The order of characters in the returned list should be based on when they reach the number threshold in the string.
  • If no characters appear at least number times, return an empty list.

Examples:

find_similar("apple", 2)  # Returns ['p']
find_similar("banana", 2)  # Returns ['a', 'n']
find_similar("Mississippi", 3)  # Returns ['i', 's']
find_similar("AaBbCc", 2)  # Returns ['A', 'B', 'C']
find_similar("aAaAaA", 3)  # Returns ['a']

Similar Kata:

Stats:

CreatedAug 1, 2024
Warriors Trained20
Total Skips0
Total Code Submissions40
Total Times Completed18
Python Completions18
Total Stars0
% of votes with a positive feedback rating63% of 12
Total "Very Satisfied" Votes6
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes3
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • AnyoneClown Avatar
Ad