Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 400 Bytes

File metadata and controls

19 lines (12 loc) · 400 Bytes

Easiest solution to understand the solution

  1. Create two arrays of 26 Characters
  2. Count the frequency of characters in the first string
  3. Count the frequency of characters in the second string
  4. Calculate the difference in character frequencies
  5. Return the difference Value

Example 1:

Input: s = "leetcode", t = "coats"

Output: 7

Example 2:

Input: s = "night", t = "thing"

Output: 0