Coding problem: Anagram difference

I was given this problem in an online coding assessment

Md Shadekur Rahman
coding interview preparation
2 min readSep 7, 2023

--

Problem description

An anagram is a word whose characters can be rearranged to create another word. Given two strings, determine the minimum number of characters in either string that must be modified to make the two strings anagrams. If it is not possible to make the two strings anagrams, return -1.

Constraints:

  • Each string consists of lowercase letters [a-z].

--

--