How to flatten a table of key-value pairs where some values are also keys
I am looking for an example of recursion to flatten a table of key-value pairs were some values are also keys. The code below, which is offered only for guidance, results in an incomplete output: