type-challenges/questions/15260-hard-tree-path-array
2023-12-26 06:07:37 +01:00
..
2023-12-26 06:07:37 +01:00
2022-12-20 12:15:46 +01:00
2022-10-28 00:04:27 +00:00

Tree path array hard

by Neil Richter @noook

Take the Challenge

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']

Back Share your Solutions Check out Solutions