CJCoding With Joseph
15free / daySign inCreate account

Duplicates By Brute Force

Write has_duplicates_brute(values: list[int]) -> bool that returns True when any value appears more than once and False otherwise, using two nested for loops over indexes so that every pair of positions with i before j is compared exactly once; this is O(n squared). Do NOT write a main block or any top-level test code; the tests construct the calls. Input: one line of space-separated integers (possibly empty); the tests print the boolean your function returns.

Expected Output:

True

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Data Structures & AlgorithmsBig-O
📥 Auto-Input:
3 1 4 1 5\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.