Imagine a random number of square sprites of any size are created in random positions like so
https://i.imgur.com/JcJgOGW.png
Now I need to find a way to create a sort of perimeter with the arrangement like so
https://i.imgur.com/RQtHCpc.png
The sprites could be overlapping and in completely random positions. How can I go about doing this? I want to avoid checking for any kind of collisions or overlapping for performance reasons.
A basic perimeter is also fine, doesn't have to touch each corner of the square.