You are given two string arrays positive_feedback and negative_feedback, containing positive and negative words respectively. You are also given two arrays report and student_id, where report[i] is a report describing the student with ID student_id[i], and an integer k.
Each student initially has report[i]:
Every occurrence of a word from positive_feedback increases the score by
Every occurrence of a word from negative_feedback decreases the score by
Return the IDs of the top k students sorted in descending order of their total score. If two students have the same score, the student with the smaller student_id ranks higher.
Constraints:
positive_feedback.length, negative_feedback.length
positive_feedback[i].length, negative_feedback[j].length
Both positive_feedback[i] and negative_feedback[j] consist of lowercase English letters.
No word is present in both positive_feedback and negative_feedback.
n report.length student_id.length
report[i] consists of lowercase English letters and spaces ' '.
There is a single space between consecutive words of report[i].
report[i].length
student_id[i]
All the values of student_id[i] are unique.
You are given two string arrays positive_feedback and negative_feedback, containing positive and negative words respectively. You are also given two arrays report and student_id, where report[i] is a report describing the student with ID student_id[i], and an integer k.
Each student initially has report[i]:
Every occurrence of a word from positive_feedback increases the score by
Every occurrence of a word from negative_feedback decreases the score by
Return the IDs of the top k students sorted in descending order of their total score. If two students have the same score, the student with the smaller student_id ranks higher.
Constraints:
positive_feedback.length, negative_feedback.length
positive_feedback[i].length, negative_feedback[j].length
Both positive_feedback[i] and negative_feedback[j] consist of lowercase English letters.
No word is present in both positive_feedback and negative_feedback.
n report.length student_id.length
report[i] consists of lowercase English letters and spaces ' '.
There is a single space between consecutive words of report[i].
report[i].length
student_id[i]
All the values of student_id[i] are unique.