amounts holds the totals of a day's receipts. Check whether two receipts at **different** positions exist where one is exactly twice the other: amounts[i] == 2 * amounts[j] with i != j.
Return True if such a pair exists, and False otherwise.amounts=[7, 3, 12, 6] → True
12 is exactly twice 6.
amounts=[5, 9, 4, 11] → False
No number is double another one.
amounts=[0, 8, 0] → True
Zero is twice zero, and there are two zeros here at different positions.
amounts[i] ≤ 1000amounts=[7, 3, 12, 6]
True
Run checks the first 3 tests in your browser. Submit checks all 131 tests on the server, hidden ones included.