Content pfp
Content
@
0 reply
0 recast
0 reaction

peanuts pfp
peanuts
@huashengdou
def remove_duplicates(s: str) -> str: result = "" # Initialize an empty string to store the characters after removing duplicates for char in s: # Iterate through each character in the string if char not in result: # If the character is not already in the result string result += char # Add the character to the result string return result # Return the string after removing duplicates # Test print(remove_duplicates("abcabcbb")) # Output: "abc"
0 reply
0 recast
1 reaction