That's not really what happened though. I had a contract for a minimum of four months on the apartment. Which wouldn't have been a problem for me even if I quit after three months.
I deposited the last months rent when I signed the contract. When I informed the landlord that I could only stay two months, she kept the deposit and forced me to leave the apartment in the middle of the second month.