Skip to content
We areTOP 1%

Inaccurate Subsequence Search

MediumRating 1400CodeforcesMixed Practice
Solve on Codeforces(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Approach hintTry it first, then reveal

Slide a window of length m over a and maintain how many of its elements can be matched against the multiset b, using count maps for b and for the window, so each shift updates the match count in O(1).

More in Mixed Practice

Mixed Practice questions
#ProblemPlatformDifficultyOpen1st1st Visit2nd2nd VisitRevRevise
1White-Black Balanced SubtreesCodeforcesMedium 1300Solve White-Black Balanced Subtrees on Codeforces (opens in a new tab)
2Binary Tree Right Side ViewLeetCodeMedium Solve Binary Tree Right Side View on LeetCode (opens in a new tab)
3Hand of StraightsLeetCodeMedium Solve Hand of Straights on LeetCode (opens in a new tab)
4Word SearchLeetCodeMedium Solve Word Search on LeetCode (opens in a new tab)
5Path Sum IIILeetCodeMedium Solve Path Sum III on LeetCode (opens in a new tab)
6VacationsCodeforcesMedium 1400Solve Vacations on Codeforces (opens in a new tab)
7RationalLeeCodeforcesMedium 1400Solve RationalLee on Codeforces (opens in a new tab)
8Inaccurate Subsequence SearchCodeforcesMedium 1400Solve Inaccurate Subsequence Search on Codeforces (opens in a new tab)
9Schedule ManagementCodeforcesMedium 1400Solve Schedule Management on Codeforces (opens in a new tab)
10Epic TransformationCodeforcesMedium 1400Solve Epic Transformation on Codeforces (opens in a new tab)
11Cyclic ComponentsCodeforcesMedium 1500Solve Cyclic Components on Codeforces (opens in a new tab)
12Trapping Rain WaterLeetCodeHard Solve Trapping Rain Water on LeetCode (opens in a new tab)

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account