Given an array of string paths folder, remove all subfolders and return the remaining folders in any order.
A folder path folder[i] is considered a subfolder of folder[j] if folder[i] starts with folder[j] followed by '/'. For instance, "/a/b" is a subfolder of "/a", whereas "/ab" is not a subfolder of "/a".
Constraints:
folder.length
folder[i].length
folder[i] contains only lowercase letters and '/'.
folder[i] always starts with the character '/'.
Each folder name is unique.
Given an array of string paths folder, remove all subfolders and return the remaining folders in any order.
A folder path folder[i] is considered a subfolder of folder[j] if folder[i] starts with folder[j] followed by '/'. For instance, "/a/b" is a subfolder of "/a", whereas "/ab" is not a subfolder of "/a".
Constraints:
folder.length
folder[i].length
folder[i] contains only lowercase letters and '/'.
folder[i] always starts with the character '/'.
Each folder name is unique.