Let's talk about my unique tree structure:
{
"id": 0,
"parentId": null,
"name": "Tech Company",
"children": [
{
"id": 1235,
"parentId": 0,
"name": "Software Development",
"children": [
{
"id": 3333,
"parentId": 154,
"name": "Web Development",
"children": [],
"companies": [
{
"id": 348,
"name": "Google"
},
{
"id": 30,
"name": "Microsoft"
}
]
},
{
"id": 319291392,
"parentId": 318767104,
"name": "Mobile App Development",
"children": [],
"companies": [
{
"id": 353,
"name": "Apple"
},
{
"id": 19,
"name": "Samsung"
}
]
}
],
"companies": [
{
"id": 35715,
"name": "Amazon"
},
{
"id": 85,
"name": "Facebook"
}
]
}
]
}
I am on a mission to locate objects by their specific ids. For example, if I'm in search of an object with id:353, I would retrieve:
{"id": 353,"name": "Apple"}
If I need to find an object with id:1235
, the output should be:
{"id": 1235,"name": "Software Development"}
Despite numerous attempts, the intricate nature of this tree makes it challenging for me to accomplish my goal.