Sofdor Ali and Bracket SequenceSofdor Ali has invented a new game. He asked his assistant Jong Bahadur ( who happens to be a monkey...

Smallest SubarrayYou are given an array A of N integers A1, A2, A3, ..., AN . If we select two indices (1 ≤ i ≤ j ≤ N...

DistinctnessA substring of string S is another string S' which occurs in string S. For example: S = aaba and one...

How Hasinur Met His GirlfriendsHasinur didn't Know how to count number of distinct substrings of a given string. That is why he di...

Unique Substrings QueryYou will be given a string s of length n. Consider substring s[i, n] (where i is the starting positi...

Simple As a Substring!Many years have passed after Simba's death. The jungle has a new lion cub born just a few hours ago....

The Story of StringlandThe king of Stringland is employing an elite force of undercover agents to protect the kingdom from ...

2Sat, Adhoc, ApolloneasTheorem, Backtracking, BFS, Bignum, BinarySearch, BipartiteMatching, Bitmask, BruteForce, ChineseRemainderTheorem, Combinatorics, ConvexHull, CutVertex, DataStructure, DFS, DigitDP, DisjointSets, DivideAndConquer, DP, Eertree, EulerTour, ExpectedValue, FenwickTree, FFT, Flow, Game, GCD, Geometry, Graph, Greedy, Hashing, HeavyLightDecomposition, Implementation, InclusionExclusion, Interactive, KnuthMorrisPratt, LowestCommonAncestor, Math, Matrix, MatrixExponentiation, MergeSortTree, ModularExponentiation, MOSAlgorithm, MST, NTT, NumberTheory, Parsing, PersistentLiChaoTree, PersistentSegmentTree, PollardRho, PriorityQueue, Probability, Queue, RabinMiller, RangeOrderStatistics, Scheduling, SegmentTree, ShortestPath, Simulation, Sorting, SparseTable, SpragueGrundyTheorem, SqrtDecomposition, Stack, String, StronglyConnectedComponents, SuffixStructure, TernarySearch, Tree, Trie, TwoPointer, WaveletTree