Dsa
Sliding Window
Medium
Substring Anagram Count
Write a program that reads a string and a substring. Count the number of occurrences of the substring's anagrams within the string. For example, "abc" is an anagram of both "abc" and "cab". The program should ignore character case.
Input format:
The first line contains the string.
The second line contains the substring.
Output format:
Print a single integer representing the count of occurrences of anagrams.
Example:
Input:
abCbaC
abc
Output:
2
Key concepts
sliding_windowstring_manipulation
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now