Best way to determine if there is a gameobject in multiple locations?

Hi all. How do I determine if there are no gameobjects in set locations?

I’m making a 2d tile based game and I want to check if there are any gameobjects in a set coordinate.
I have no problems checking if there are any gameobjects in a location. I just ran a foreach for every gameobject with certain tags and do actions if they are in certain tiles. However, I don’t know what to do for empty tiles.

I’m planning to make an empty gameobject with a collider then iterate it through the locations and check if there are any trigger/collision to other gameobjects. Should I got through this method or are there any simpler way to do this?
Thank you in advance.

Well, I can think of a couple of solutions.

First and easiest: just have a logical representation of your map. Being a 2d array, text file, whatever you want. Make your objects update your logical map whenever they move/change position and then you only need to check your logical map at the desired position.

Second: Create an array of tile positions on top of the tiles and send raycasts from each tile position to the tile. If collides with any object, then the tile is occupied. Else, it’s free.