Skip to content

Instantly share code, notes, and snippets.

View hikionori's full-sized avatar
🤔
Works on my machine™

Danila Verbinskiy hikionori

🤔
Works on my machine™
View GitHub Profile
@hikionori
hikionori / main.py
Created March 5, 2024 09:37
example of search function with O(n^3) complexity
# create realisation of the function that will search for the target in the array
# with the complexity of O(n^3)
# function return index of the target in the array
def search_on3(array: list[int], target: int) -> int:
for i in range(len(array)):
if array[i] != target:
continue
for j in range(len(array)):
if array[j] != target:
continue