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

Stats:

CreatedJun 26, 2017
Warriors Trained75
Total Skips0
Total Code Submissions50
Total Times Completed8
JavaScript Completions8
Total Stars1
% of votes with a positive feedback rating0% of 4
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes4
Total Rank Assessments5
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • alrazy1@gmail.com Avatar
  • siebenschlaefer Avatar
  • JohanWiltink Avatar
Ad