Problem Challenge: Folder Count

Solve a problem to test and practice your knowledge and understanding of file systems.

Problem statement

Implement two methods—directoryInsert and directoryMatchCount—for the provided directory paths.

The directoryInsert method takes the directory path as the input to create the given path.

The directoryMatchCount method returns the count of folders that are present from the start to the end of the path sequence.

Example 1

Sample input

Get hands-on with 1400+ tech skills courses.