FastPrepCount Words Formable from Letters
Problems/Count Words Formable from Letters

Count Words Formable from Letters

ZipRecruiter logoZipRecruiter● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA report describes words without punctuation, comparing without regard to case, a letter supply where each letter can be used only as many times as it occurs, and a Hello example returning two. We supplied ASCII word boundaries and a function signature.

Split text into maximal English-letter words, ignoring punctuation. Count how many words can be formed from the case-insensitive letter multiset letters, using each supplied occurrence at most once per word.

Function

countFormableWords(text: String, letters: String) → int

Examples

Example 1

text = "Hello, hole! world."letters = "helloo"return = 2

Hello and hole are formable; world requires unavailable letters.

Example 2

text = "Cat dog"letters = "tac"return = 1

Cat is formable case-insensitively, while dog is not.

Constraints

  • 0 <= text.length,letters.length <= 100000

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Perfect SubstringAXQ Capital · OA
  • Count Suffix Word PairsTikTok · OATikTok interview questions
  • Password Clues and the Next CommandOpenAI · OAOpenAI interview questions
  • Decode Words with Anagram KeysCresta · OACresta interview questions
  • Count One-Swap Number PairsCapital One · OACapital One interview questions
  • Parcel Event TrackingAirbnb · OAAirbnb interview questions
  • Maximum Valid Substring FrequencyMicrosoft · OAMicrosoft interview questions
  • Longest Distinct StringSuperhuman · OASuperhuman interview questions
  • Longest String ChainVisa · OAVisa interview questions
  • Longest Substring Without Repeating CharactersAkuna Capital · OAAkuna Capital interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int countFormableWords(String text, String letters) {
        // Write your code here.
    }

}
Checking account…