At one of Amazon’s busy warehouses, Team Alpha and Team Beta are assigned the task of processing n products for shipment. Each product handled by Team Alpha is labeled as inventory_alpha[i], and the corresponding product handled by Team Beta is labeled as inventory_beta[i].
For every product pair (inventory_alpha[i], inventory_beta[i]), Team Alpha is allowed to repeatedly perform the following operation on their product label:
Your task is to determine, for each product pair, whether Team Alpha can transform inventory_alpha[i] into inventory_beta[i] by performing the swap operation any number of times (including zero), while following these constraints:
The original problem asks to return bool[], but I modified it to int[]. 1 represents true, while 0 represents false.
inventory_alpha = ["abba"] inventory_beta = ["adda"] return = 1

inventory_alpha = ["azzel"] inventory_beta = ["apple"] return = 1
- 1 ≤
n≤ 10^5 - 1 ≤ |
inventory_alpha[i]|, |inventory_beta[i]| ≤ 2*10^5 - |
inventory_alpha[i]| = |inventory_beta[i]| inventory_alpha[i]andinventory_beta[i]contain only lowercase Latin letters.- The sum of lengths of all strings in
inventory_alphaandinventory_betadoes not exceed 5 * 10^5
- Count Promotional PeriodsOA · Seen Jun 2026
- Find Maximum Total Amount (SDE I, Fungible :)Seen Jun 2026
- Get Minimum AmountOA · Seen Jun 2026
- Find Minimum CostOA · Seen Jun 2026
- Get Smallest Base SegmentOA · Seen Jun 2026
- Select Least Resource TasksOA · Seen Jun 2026
- Product Category Group SizesPHONE SCREEN · Seen May 2026
- Count Connected ComponentsPHONE SCREEN · Seen May 2026
public int[] equalProducts(String[] inventory_alpha, String[] inventory_beta) {
// write your code here
}