threeal / leetspace

A dedicated workspace and archive for my LeetCode submissions
https://leetcode.com/threeal
MIT License
1 stars 1 forks source link

Solve Problem 2135. Count Words Obtained After Adding a Letter #1363

Closed threeal closed 1 month ago

threeal commented 1 month ago

This pull request resolves #1362 by solving the problem 2135. Count Words Obtained After Adding a Letter in C++.

It solves the problem by mapping each string to a 26-bit mask representing the presence of each letter. It then iterates through the bit masks of the target strings and checks whether any bit mask of the target string, which is missing exactly one bit, exists in the bit masks of the start strings.