File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -328,26 +328,26 @@ Sorting Sets
328328 -----
329329 def unique_characters(strings):
330330 =====
331- # Initialize an empty set to store unique characters
331+ # Init an empty set
332332 unique_chars = set()
333333 =====
334- # Iterate over each string in the list
334+ # Loop through the strings
335335 for string in strings:
336336 =====
337- # Add all characters of the current string to the set
337+ # Add the chars in string
338338 unique_chars.update(string)
339339 =====
340- # Add all characters of the current string to the set
340+ # Add the chars in string
341341 unique_chars.add(string) #paired
342342 =====
343- # Convert the set to a sorted list
344- sorted_unique_chars = sorted(unique_chars)
343+ # Convert to a sorted list
344+ sorted_chars = sorted(unique_chars)
345345 =====
346- # Convert the set to a sorted list
347- sorted_unique_chars = sort(unique_chars) #paired
346+ # Convert to a sorted list
347+ sorted_chars = sort(unique_chars) #paired
348348 =====
349- # reurn the sorted list of unique characters
350- return sorted_unique_chars
349+ # return the sorted list
350+ return sorted_chars
351351
352352
353353Dictionaries
You can’t perform that action at this time.
0 commit comments