Retired
smart categories object (retired)
Description:
Given a tree object categories
representing a category tree:
Node:
value : <string>,
children : array of nodes,
.
.
children : array of nodes
write a function that returns an array containing all the possible paths of a given category in a given categories tree.
vehicles
| \
cars trucks
| \ \
fiat mercedes mercedes
getPathsOf('mercedes', {/* like the above tree */})
should return ['vehicles/cars/mercedes','vehicles/trucks/mercedes']
Please see the test cases and write your own categories and test cases.
Algorithms
Recursion
Computability Theory
Logic
Theoretical Computer Science
Trees
Data Structures
Similar Kata:
Stats:
Created | Jun 26, 2017 |
Warriors Trained | 75 |
Total Skips | 0 |
Total Code Submissions | 50 |
Total Times Completed | 8 |
JavaScript Completions | 8 |
Total Stars | 1 |
% of votes with a positive feedback rating | 0% of 4 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 5 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |