P15465 [GeeksforGeeks] Check if two strings are k anagrams or not
普及-
题目描述

Given two strings of lowercase alphabets and a value K, your task is to complete the given function which tells if two strings are K-anagrams of each other or not.
Two strings are called K-anagrams if both of the below conditions are true.
1. Both have same number of characters.
2. Two strings can become anagram by changing at most K characters in a string.
Example:
Input:
str1 = "fodr", str2="gork"
k = 2
Output:
1
Explanation: Can change fd to gk
Your Task:
Since this is a function problem, you don't need to take any input. Just complete the given function areKAnagrams that returns true if the strings can be turned into K-anagrams, else return false.
Constraints:
1 ≤ length of String ≤ 10^{5}
1 ≤ K ≤ length of String

输入格式

见题面

输出格式

见题面

样例输入
str1 = "fodr", str2="gork" k = 2
样例输出
1