from typing import Any


def update_nested(the_dict: dict, nested_key: str, value: Any):
    """
    Updates nested keys inside a dictionary

    Args:
        the_dict (dict): The dictionary to be updated
        nested_key (str): The nested key
        value: The value to be set to the nested key

    Examples:
        >>> t = {}
        >>> update_nested(t, 'a:b:c', 1)
        >>> t
        {'a': {'b': {'c': 1}}}
        >>> update_nested(t, 'a:b:d', 1)
        >>> t
        {'a': {'b': {'c': 1, 'd': 1}}}
        >>> update_nested(t, 'a:b:c', 2)
        >>> t
        {'a': {'b': {'c': 2, 'd': 1}}}
    """
    keys = nested_key.split(':')

    if len(keys) == 1:
        the_dict.update({keys[0]: value})
    else:
        if keys[0] not in the_dict:
            the_dict[keys[0]] = {}
        update_nested(the_dict[keys[0]], ':'.join(keys[1:]), value)

    return the_dict