How to stop rogue-like dungeon prefab rooms spawning on top of each other (C#)

Hey all,
This is my first time attempting a rogue-like dungeon room generator, I’ve got a solid start. I have a script that spawns a random number of pre-fab rooms in random locations. The problem is, some of those rooms spawn on top of eachother, I don’t want to increase the map size.

void Start ()
    {
        roomsToBeSpawned = Random.Range(8, 12);
        for (int i = 0; i < roomsToBeSpawned; i++)
        {
            Vector3 spawnLocation = new Vector3(Random.Range(minX, maxX), Random.Range(minY, maxY), 0.0f);
            Instantiate(rooms[Random.Range(0, 4)], spawnLocation, Quaternion.identity);
        }
    }

This is what I’ve got so far and it’s working as intended. Just need a some help or a point in the right direction on how to stop the rooms from spawning on top of eachother. I should mention each room is a sprite, all 5 rooms have a different size.
Thankyou!

use a list to store all the locations of the different squares that are blocked and use a check before you instantiate to check its free, Unity 3D - Random Level Generation Tutorial - Part 1 - Intro - 2D - - YouTube is perfect to teach the basics, with a bit of common sense making it into 3d is just as easy