Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Stack;
public class ExclusiveTimeOfFunction {
public static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
int n;
int logsNum;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
class LetterCombinations
{
private List<String> combinations = new ArrayList<>();
private Map<Character, String> letters = Map.of(
'2', "abc", '3', "def", '4', "ghi", '5', "jkl",
'6', "mno", '7', "pqrs", '8', "tuv", '9', "wxyz");
import java.util.LinkedList;
import java.util.Queue;
public class SerializeDeserializeBinaryTree {
//Definition for a binary tree node.
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
import java.util.*;
public class Main {
public static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
String s = input.next();
String t = input.next();
Solution solution = new Solution()
System.out.println(solution.minWindow(s, t));
}
class Solution
{
//The function checks if a substring with given start and end points
//is a palindrome or not.
public boolean isPalindrome(String s, int start, int end)
{
while (start < end)
{
if (s.charAt(start) != s.charAt(end))
return false;
public class Main
{
private String findLongestPalindromicSubstring(String input)
{
//If empty, does not analyze the string
if(input.isEmpty())
{
return "";
}
import java.util.*;
public class LRUCache {
//double linked list class
class DLinkedNode {
int key;
int value;
DLinkedNode prev;
DLinkedNode next;
import java.util.*;
class Solution {
public int[] findOrder(int numCourses, int[][] prerequisites) {
//A map to model the graph
Map<Integer, List<Integer>> adjList = new HashMap<Integer,
List<Integer>>();
//To save the indegree of each node in the graph
import java.util.*;
public class Solution {
//Takes a 2D array as the input
public int numIslands(char[][] grid) {
//If empty, returns 0
if(grid == null || grid.length == 0)
{
import java.util.Arrays;
import java.util.Comparator;
public class Solution {
//A method to return the number of used rooms
public int minMeetingRooms(int[][] intervals) {
//If input == null, does not process it