Word Rank Code Coach Help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Word Rank Code Coach Help

It seems I don't understand the question because I don't get how Case 1's rank is "13" instead of "2". So I'd like some help or hints on how to format my code properly. https://sololearn.com/compiler-playground/clRkJBWVSidp/?ref=app

15th Apr 2024, 3:18 PM
Ikenna Onwuka
Ikenna Onwuka - avatar
1 Answer
+ 2
Ikenna Onwuka , here are the task steps: (maybe this can help you understand the task) > take an input as string like "ABAB" > create all combinations of the input by avoiding duplicates! store items in an array / list like: ['ABAB', 'BBAA', 'BABA', 'ABBA', 'BAAB', 'AABB'] > sort these elements like: ['AABB', 'ABAB', 'ABBA', 'BAAB', 'BABA', 'BBAA'] > now find the position of the input string in the sorted array / list > result is found in the second position.
15th Apr 2024, 7:00 PM
Lothar
Lothar - avatar