from typing import List


def linear_search(array: List[int], query: int) -> int:
    """Linear search works on any array.
    It returns the index of the given number in the array if it finds it.
    Returns -1 if it doesn't.
    It looks for the index by going over each array element and comparing it to the query.
    Time complexity: O(N)"""

    for i in range(len(array)):
        if array[i] == query:
            return i

    return -1