from typing import Sequence
from typing import Any
from operator import getitem


def last(obj: Sequence[Any]) -> object:
    """Return the last item of an array"""
    if isinstance(obj, str):
        return None

    try:
        return getitem(obj, -1)
    except (TypeError, KeyError, IndexError):
        return None