Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1915. Number of Wonderful Substrings
Count the number of non-empty substrings (in a string of letters 'a'–'j') whose character counts have at most one odd frequency. Core idea: track a 10-bit parity mask for prefix counts and count pairs of prefixes with equal masks (all even) or masks differing by one bit (one odd) to obtain an O(n) solution.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.