If they are both single I’d recommend they love where they live and make sacrifices later.
If it was me I’d probably buy a condo near the beach that would become a rental when they move inland a bit after they get married and want more space. You could also go the route of buying the rentals inland, but I’d be worried that inland will be the first to fall in a downturn.
I never recommend buying anywhere unless you are living in it (and optimistically paying about what rent would be) or if you are cash flowing (or breaking even in a really good area).