Trains the technique from
LeetCode 184SumThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A test bench stacks probe cards to cancel out a bias. You are given the integer array offsets, holding one signed bias figure per card in the tray, and an integer target.
Report every group of four cards whose bias figures total target. A group picks four distinct tray positions, so no card may be counted twice inside one group.
Two groups are the same group when they hold the same four figures with the same repeats, whichever tray positions supplied them; report such a group once only. Write the four figures of a group in non-decreasing order. The groups themselves may come back in any order. Return an empty list when no four cards total target.
Example 1
All four cards must be used, and 1 + 5 + 3 + 6 is 15, so the single group is the whole tray written in non-decreasing order.
Example 2
Two distinct groups of figures reach 0 here; either ordering of the two groups is accepted.
Example 3
Only three cards sit in the tray, so no group of four exists and the report is empty.
The values you return may be in any order.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def bias_quartets(offsets: list[int], target: int) -> list[list[int]]:public List<List<Integer>> biasQuartets(int[] offsets, int target)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.