def _reverse_str_to_int(x: int) -> int:
    """

    Args:
        x: 32-bit signed integer

    Returns: x with digits reversed if it would fit in a 32-bit signed integer,
             0 otherwise

    Examples:
        >>> _reverse_str_to_int(123)
        321
        >>> _reverse_str_to_int(-123)
        -321
        >>> _reverse_str_to_int(120)
        21
        >>> _reverse_str_to_int(0)
        0
        >>> _reverse_str_to_int(1534236469)
        0

    """

    """ALGORITHM"""
    ## INITIALIZE VARS ##
    sign = -1 if x < 0 else 1

    ## REVERSE positive string version and reapply the original sign
    reversed_x = sign * int(str(abs(x))[::-1])

    ## Return reversed_x if it can be represented as a 32-bit signed integer
    return reversed_x if -(2 ** 31) <= reversed_x <= (2 ** 31) - 1 else 0