Ad

Given a list of strings, return an object that represents the tree structure.

getTree([
'src/main.js',
'src/second.js',
'src/components/header.js',
'src/components/helpers/sidebar.js'
]) -> {
  "src": {
      "main.js": "file",
      "second.js": "file",
      "components": {
          "header.js": "file",
          "helpers": {
            "sidebar.js": "file",
          },
      }    
  }
}
function getTree(strings) {
  // code
}