type-challenges/questions/15260-hard-tree-path-array
github-actions[bot] 13102e9baf
feat(question): add #15260 - Tree path array (#15261)
Co-authored-by: Neil Richter <19751938+noook@users.noreply.github.com>
2022-10-27 15:17:45 +08:00
..

Create a type Path that represents validates a possible path of a tree under the form of an array.

Related challenges:

declare const example: {
    foo: {
        bar: {
            a: string;
        };
        baz: {
            b: number
            c: number
        }
    };
}

/* Possible solutions: 
[]
['foo']
['foo', 'bar']
['foo', 'bar', 'a']
['foo', 'baz']
['foo', 'baz', 'b']
['foo', 'baz', 'c']
*/