[Solution] 3SUM Codeforces Solution | Codeforces Problem Solution 2022
Given an array of positive integers with length , determine if there exist three distinct indices , , such that ends in the digit .
The first line contains an integer () — the number of test cases.
The first line of each test case contains an integer () — the length of the array.
The second line of each test case contains integers () — the elements of the array.
The sum of across all test cases does not exceed .
Output lines, each of which contains the answer to the corresponding test case. Output "YES" if there exist three distinct indices , , satisfying the constraints in the statement, and "NO" otherwise.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
No comments:
Post a Comment