Z44

Advantage Shuffle (Greedy Comparison)

Mid / Senior Engineer
Target Time: 25 - 35 Minutes
Type: ARRAY

Problem Statement & Objective

Given two integer arrays nums1 and nums2 of the same size, maximize the number of indices where nums1[i] > nums2[i].

Function Signature (Python)

advantage_shuffle_greedy_comparison(nums1: list[int], nums2: list[int]) -> list[int]

Input & Output Contract

Output Rule:Yeniden dizilmiş sayilar1 listesi.

System Constraints

1 <= sayilar1.length <= 10^5
sayilar2.length == sayilar1.length
0 <= sayilar1[i], sayilar2[i] <= 10^9

Example Execution Walkthrough

sayilar1 = [2, 7, 11, 15], sayilar2 = [1, 10, 4, 11]
cevap: [2, 11, 7, 15] (4 eşleşmenin 4'ü de kazanır)

Example Test Scenarios (3)

Example 1
Input:[[2,7,11,15],[1,10,4,11]]
Expected Output:[2,11,7,15]
Example 2
Input:[[12,24,8,32],[13,25,32,11]]
Expected Output:[24,32,8,12]
Example 3: Kazanamaz
Input:[[1],[2]]
Expected Output:[1]
Loading Python Editor...
Input Parameters
[
  [
    2,
    7,
    11,
    15
  ],
  [
    1,
    10,
    4,
    11
  ]
]
Expected Output
[
  2,
  11,
  7,
  15
]