mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-07-04 11:36:52 -04:00
Update array-check-if-exist.py
This commit is contained in:
parent
79f1970f2e
commit
0672ae9a3a
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# author: bt3gl
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Given an array arr of integers, check if there exist two indices i and j such that :
|
Given an array arr of integers, check if there exist two indices i and j such that :
|
||||||
|
|
||||||
|
@ -24,4 +28,4 @@ def check_if_exist(arr: list[int]) -> bool:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
arr = [-2, 0, 10, -19, 4, 6, -8]
|
arr = [-2, 0, 10, -19, 4, 6, -8]
|
||||||
print(check_if_exist(arr))
|
print(check_if_exist(arr))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue