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.LinkedList; | |
import java.util.List; | |
class Node { | |
int data; | |
Node next; | |
Node prev; | |
} | |
class MyDoubleLinkedList { |
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
// Java Code | |
import java.util.HashMap; | |
import java.util.Map; | |
// Time Complexity: O(n) | |
// Space Complexity: O(n) | |
// where n = length of string | |
class Solution { | |
public static final int MAX_UNICODE = 65_535; | |
public static boolean checkWhetherStringIsUnique(String string) { |
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
// In Java | |
import java.util.*; | |
class Question1 { | |
// Please try not to change anything in this method. | |
public static void main(String[] args) { | |
int[] numbers = new int[15]; | |
addRandomNumbers(numbers); | |
System.out.println(Arrays.toString(numbers)); | |
System.out.println(findPairsByList(numbers, 10)); |