This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
class Duplicates { | |
public static Map<Character, Integer> countDuplicateCharacters(String string) { | |
var resultMap = new HashMap<Character, Integer>(); | |
for (int i = 0; i < string.length(); i++) { | |
int c = 0; | |
if(!Character.isWhitespace(string.charAt(i))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
class Question2 { | |
public static final int MAX_UNICODE = 65_535; | |
public static void main(String[] args) { | |
System.out.println(checkWhetherStringIsUnique("Competitive Programming")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Pair { | |
int x; | |
int y; | |
@Override | |
public String toString() { | |
return "{" + | |
"x=" + x + |