Skip to content

Instantly share code, notes, and snippets.

View aryan-dixit-26's full-sized avatar
✌️

Aryan Dixit aryan-dixit-26

✌️
View GitHub Profile
@aryan-dixit-26
aryan-dixit-26 / scratch_4.java
Created January 16, 2021 20:48
Answer - QUESTION1 : Pairs
import java.util.*;
class Pair {
int x;
int y;
@Override
public String toString() {
return "{" +
"x=" + x +
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"));
}
@aryan-dixit-26
aryan-dixit-26 / scratch_8.java
Created January 31, 2021 08:36
Answer : 3 Answer : 3
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)))