I'm really struggling with this algorithm. It needs to be recursive, but I can't seem to crack it. Any help would be greatly appreciated. Thank you!
Here is the problem: ['a','b','c',['d','e','f',['g','h']], [i, j, k]]
Desired Output:
{
a: true,
b: true,
c: true,
d: {
e: true,
f: true,
g: {
h: true
}
},
i: {
j: true,
k: true
}
}