• "Does not accept solution", why? My code below

Question related to mission The Flat Dictionary

 

def flatten(dictionary): stack = [((), dictionary)] result = {} while stack: path, current = stack.pop() for k, v in current.items(): if v == {}: v = '' if isinstance(v, dict): stack.append((path + (k,), v)) else: result["/".join((path + (k,)))] = v return result