Question: Write a static method named problem 2 that accepts a string and a positive integer k . Find and return a list with any k
Write a static method named problem that accepts a string and a positive integer k Find and return
a list with any k distinct characters. If k is greater than the length of the given string, return all the
distinct characters. You cannot use the collections module to solve this problem.
Call the function with the test case and display the return result.
Test case: if the given string is aaabbbcccdddeeefffggg and k your function should return any
five distinct characters, egabcde
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
