Skip to content

Commit a955a9d

Browse files
author
Devansh K Shukla
committed
add an if() block along with a condition inside the for loop
1 parent ab17cb4 commit a955a9d

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.idea/workspace.xml

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/io/github/dbc/DuplicateCharactersCounter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public Map<Character, Integer> countDuplicateCharacters(String string) {
1414
HashMap<Character, Integer> map = new HashMap<>();
1515
for (int i = 0; i < string.length(); i++) {
1616
char ch = string.charAt(i);
17+
if (map.containsKey(ch)) {
18+
19+
}
1720
}
1821
return Map.of();
1922
}

0 commit comments

Comments
 (0)