It took me a while to understand, but what the question is asking is for you to arrange the array so that matching indices are greater than or equal to k. So the trick is to sort them both, reverse one of the arrays so then you can just compare A[i] to B[i]. Logically, that would be the only configuration that they would come together and match that condition. Then, if even one of those indices doesn't fit the condition, it returns NO. Sorry if this is all obvious to you.
That was a mistake on my part. I should've said A[0] B[0] not A[0] B[1]. Glad you caught that. Ill make a note of it and reshoot it. I've been building a backlog of hackerrank and leetcode problems and will be posting them on my main channel ru-vid.com/show-UCHaQP7nzYZ8Q-fhXZhqwV5w soon