Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class RemoveDuplicateCharsInString {
// 输入ccbbaa返回cba
// 输入apple返回aple
public static String removeDuplicateCharsInString(String s) {
HashSet<Character> charSet = new HashSet<>();
HashSet<Character> charSet = new LinkedHashSet<>();
for (int i = 0; i < s.length(); i++) {
charSet.add(s.charAt(i));
}
Expand Down