Anagram Difference

Problem Overview

  • Compute, for each pair of strings, the minimum character changes needed to make them anagrams, or return -1 if not possible.
  • Inputs/outputs: arrays a and b with n pairs (1–100); strings are lowercase, length 0–10^4; output an int[] of results.
  • Constraints: only [a–z]; empty strings allowed.
  • Domain: string processing and text analysis tasks.
  • From Ixl interviews; a coding interview, interview question, and problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: