def morton2D(k, x, y):
    """
    Computes and returns the morton code of the x, y coordinates each
    represented with k bits

    Args:
        k: Bits to represent each coordinate with
        x: X coordinate
        y: Y coordinate

    Returns:
        The morton code in integer format of the x, y coordinates of size 2*k
    """

    result = (x << k) + y

    return result