dsa1 min read
Word Pattern [Easy] — Bijective Two-Way Map
Check if a string follows a given pattern using bidirectional mapping between pattern chars and words.
Read →
1575 articles
Check if a string follows a given pattern using bidirectional mapping between pattern chars and words.
Determine if a number is happy by repeatedly summing digit squares and detecting cycles using a HashSet or Floyd algorithm.
Find if any two duplicate elements are within k indices of each other using a HashMap of last-seen positions.
Find characters common to all strings in a list by intersecting their frequency arrays with element-wise minimum.
Count how many stones are jewels by storing jewel types in a HashSet and checking each stone.