Folders


Serialization Public

Hard  

20min

Implement a function folderNames, which accepts a string containing an XML file that specifies folder structure and returns all folder names that start with startingLetter. The XML format is given in the example below.

For example, for the letter 'u' and an XML file:

<?xml version="1.0" encoding="UTF-8"?>
<folder name="c">
    <folder name="program files">
        <folder name="uninstall information" />
    </folder>
    <folder name="users" />
</folder>

the function should return a collection with items "uninstall information" and "users" (in any order).

 
 


  •   Example case: java.lang.UnsupportedOperationException at Folders.folderNames(Folders.java:5)
  •   All folder names start with starting letter: java.lang.UnsupportedOperationException at Folders.folderNames(Folders.java:5)
  •   Complicated folder structure: java.lang.UnsupportedOperationException at Folders.folderNames(Folders.java:5)