from typing import Dict
from typing import Optional


def _try_combine(
    stats1: Dict[str, str], stats2: Dict[str, str]
) -> Optional[Dict[str, str]]:
    """
    Try combine two statistics dict to display in one row. If they conflict,
    returns None.
    """
    ret = {}
    if set(stats1.keys()) != set(stats2.keys()):
        return None
    for k, v1 in stats1.items():
        v2 = stats2[k]
        if v1 != v2 and len(v1) and len(v2):
            return None
        ret[k] = v1 if len(v1) else v2
    return ret