How do I eliminate duplicate files and folders in iCloud?
If you have a Macintosh, you could download a duplicate file finder such as Gemini, Photos duplicate cleaner, dr. cleaner, all available on the app store. Enable the icloud folder on your mac in Finder via Preferences (file > preferences, or cmd-,) while focusing finder to enable the iCloud folder to show on your list of shortcuts. 

You need to be logged into iCloud on your Mac to enable this, as well as have it checked to on in the icloud preference plane.

If your only device is an iPhone, perhaps there are the same type of apps in the app store. You can enable the iCloud shortcut to view your files just like on the Mac as well. But other than these options, you may need to do it manually.