Agent-Hellboy/trace-dkey

Recursive function should return path instead of printing the path

Agent-Hellboy opened this issue · 4 comments

def __trace_key(dict_key: Any, dict_value: Any, key, response: str) -> None:

This function should return the path of the key instead of printing in the mid

we can take inspiration from the following 2 problems of leetcode
https://leetcode.com/problems/count-good-nodes-in-binary-tree/
https://leetcode.com/problems/path-sum/

This is tricky as the key can be present inside 2 subdict
maybe this can be an extension to an approach of above 2 question

Hey, I would like to work on this

Sure, go ahead

any update @zluipaiva , As currently unit test is very weird #6

any update @zluipaiva , As currently unit test is very weird #6

Sorry for the delay
My idea is to have an array of paths that gets updated every time the key is found, and then we return this array. I implemented it but have to fix some things, I'll try to finish it today