This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
DSA/pair_equal.py

20 lines
388 B
Python
Executable File

#!/usr/bin/env python3
# vim: set ts=4 sw=4 et tw=80:
import sys
def contains_two_equal(A):
i = 0
while i < len(A) - 1:
j = i + 1
while j < len(A):
if A[i] == A[j]:
return True
j = j + 1
i = i + 1
return False
if __name__ == "__main__":
A = [int(x) for x in sys.argv[1:]]
print(contains_two_equal(A))