I’ve done the math and not really sure how LA is more affordable than SF if you factor in time value of money (things spread apart = commuting) and cost of keeping a car.
Also as a single person housing is flexible for most. If you rent a room in a house in SF (most apartments are houses) you’d most likely be spending less than if you rented a 1 bedroom in LA.