I have a collection of paths (e.g. C:\Users, C:\Users\cheese, D:\Shadow\stuff ,D:\Shadow). Is there any way to get rid of strings that are lesser path? e.g. to only leave C:\Users\cheese and D:\Shadow\stuff and make it FAST and memory un-intensive?
It is important that the strings can come in any order.