mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update array-check-if-exist.py
This commit is contained in:
parent
79f1970f2e
commit
0672ae9a3a
@ -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…
x
Reference in New Issue
Block a user