Special Arrays
CodeChefOpen on judge ↗
In each test cases, you are given two arrays P and Q, along with an integer k. Arrays will be of equal length (n). You can permute each array within itself so that in permuted version of P and Q, Pi+Qi >= k for each index i. You have to answer 'YES' or 'NO' according to whether such a permutation is possible or not. I/p format: N, followed by N testcases. Each test case is of following format.
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start