Files with the same content waste storage. For example, /a/b/c.txt and /a/b/e.txt both hold the string "hello". How would you optimise the storage space? Then implement it in a FileSystem class: - writefile(path, data) saves data at path. - readfile(path) returns the content saved at path. Store each distinct content…