I'd like to count and return the largest number of keys from the root('key1') to reach the end. How to compute and return the number of the deepest nest to the dictionary without using any libraries?
{'key1': {'key2': {'key3': {'key4': {'key5': {'key6': 'Y',
'key7': 'N'}},
'key8': {'key9': {'key10': 'Y', 'key11': 'N'}},
'key12': {'key13': {'key14': 'N', 'key15': 'Y'}},
'key16': {'key17': {'N': 'Y'}}}},
'key18': {'key19': {'key20': 'N', 'key21': 'N', 'key22': 'N', 'key23': 'Y'}}}}
Under the case, I expect to return 6 as a counted number.