I was unable to solve due to some syntax errors.
my application got rejected
You are given a keyword string and a review string. Your task is to determine how many substrings in the review string can match the keyword string after performing at most one adjacent swap of characters in the substring.
keyword: A string of length ( m ), representing the target keyword.review: A string of length ( n ), representing the review text.Input:
keyword = "moon"
review = "monomon"
Output:
2
Explanation:
"mono" and "moon" match the keyword after at most one adjacent swap.Input:
keyword = "java"
review = "jvaaajava"
Output:
3
You are given a list of skills and their ratings for n individuals. Your task is to maximize the sum of ratings for exactly k individuals such that the chosen individuals' skill values are strictly less than the current individual's skill value.
skills: A list of ( n ) integers, where skills[i] represents the skill value of the ( i )-th individual.ratings: A list of ( n ) integers, where ratings[i] represents the rating of the ( i )-th individual.k: An integer representing the number of individuals to select.Input:
skills = [4, 3, 5, 1]
ratings = [10, 20, 30, 40]
k = 2
Output:
50
Explanation:
4 (skill = 3, rating = 20) and 3 (skill = 1, rating = 40).Input:
skills = [2, 4, 1]
ratings = [5, 10, 15]
k = 1
Output:
15
Explanation:
1 and rating = 15.Followed by other behavorial and job related assesment