6 kyu
Unique Strings
278 of 463aditya7iyengar
Description:
Given a string that contains only letters, you have to find out the number of unique strings (including the string itself) that can be produced by re-arranging the letters of the string. Strings are case insensitive.
HINT: Generating all the unique strings and calling length
on that isn't a great solution for this problem. It can be done a lot faster...
Examples
uniqcount("AB") = 2 # "AB", "BA"
uniqcount("ABC") = 6 # "ABC", "ACB", "BAC", "BCA", "CAB", "CBA"
uniqcount("ABA") = 3 # "AAB", "ABA", "BAA"
uniqcount("ABBb") = 4 # "ABBB", "BABB", "BBAB", "BBBA"
uniqcount("AbcD") = 24 # "ABCD", etc.
Algorithms
Similar Kata:
Stats:
Created | Jan 4, 2017 |
Published | Jan 4, 2017 |
Warriors Trained | 1568 |
Total Skips | 56 |
Total Code Submissions | 4159 |
Total Times Completed | 463 |
Elixir Completions | 35 |
Ruby Completions | 65 |
Python Completions | 278 |
Haskell Completions | 18 |
Rust Completions | 24 |
D Completions | 5 |
Go Completions | 15 |
JavaScript Completions | 76 |
Total Stars | 60 |
% of votes with a positive feedback rating | 92% of 159 |
Total "Very Satisfied" Votes | 142 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |