3146. Permutation Difference between Two Strings
You are given two strings
sandtsuch that every character occurs at most once insandtis a permutation ofs.The permutation difference between
sandtis defined as the sum of the absolute difference between the index of the occurrence of each character insand the index of the occurrence of the same character int.Return the permutation difference between
sandt.
1 | class Solution { |