Write a python function called find_duplicates(s) which takes a
string, s, that may have repeated characters in it, and returns a
list of all repeated characters in the string. If you created a
string, list, dictionary, and/or set inside your function, what
data structure(s) did you create and why? What is the time
complexity of your solution and why?
Function
Parameters
A string that may contains repeated characters.
Return Value
A list of characters that have duplicates in the input string.
The characters in the list can be in any order.
Example
Write a python function called find_duplicates(s) which takes a string, s, that may have repeated characters in it, and
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a python function called find_duplicates(s) which takes a string, s, that may have repeated characters in it, and
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!