STOCKHOLM — When Morgane Oléron and her partner parted ways after 11 years — and one or both had to leave their shared condo — one of the biggest logistical problems was finding a new place to live.

Despite being repeatedly crowned as one of the most livable cities in Europe, Stockholm has a challenging rental market, especially for people who want to rent for longer than a year at a time.

After a colleague nudged her, Ms. Oléron decided to move to K9, a former hotel shared by 50 professionals in the best part of Stockholm. The building takes its name from its street address.

“I didn’t know if I would be up to it, but it turned out to work really well,” Ms. Oléron, 32, said over lunch recently. Her roommates range in age from 21 to 54 and have included doctors, lawyers, professional dancers and teachers.