Answer: WEATHERFORD Hiring | Online Assessment Interview Question | Off-Campus (2024)

Answer · Posted Jun 2026

Approach Count the frequency of every character in s. Count the frequency of every character in target. For every character required in target, calculate how many complete copies can be formed using: sFreq[i] / tFreq[i] The minimum value among all required characters is the answer. Strategy Use two frequency arrays of size 26. Store character counts of s and target. Traverse all alphabets and find the minimum possible number of copies. Return the minimum value. Java Code class Solution { ...

The full answer & interview discussion are available to premium members.

Log in Create a free account