Step 1: There are four apartments i.e. A,B,C,D each having different number of floors one above another apartment A being in the west most position and then on the east of apartment A is apartment B and so on till apartment D which is in east most position. All the apartments are adjacent to each other. two of the apartments have three floors in it and the other two apartments have four floors in it. no two apartments having same number of floors are adjacent to each other. so, there will be two possible cases such that in case 1 A and C are the apartment having four floors and B and D apartment have three floors and in case 2 A and C apartment having three floor and B and D apartment have four floors in it.
Step 2: Now it is given that there are two floors between N and M. K lives below M in the same apartment. K lives immediately below the floor which is vacant but not in the apartment C. M does not live in the apartment D. the top floor of apartment C is vacant.
Step 3: As it is given that, only one floor in each apartment are vacant and no two adjacent floors of adjacent apartments are vacant. so, case 2 will be eliminated as the third floor of both apartments B and C are vacant. Now continuing with step 1. it is given that R lives immediately above T and below the floor which is vacant. T does not live on the 1st floor of the apartment. S and T lives in the same apartment but not in apartment A. So, R, S and T lives in the same apartment which is apartment C. the second floor of the apartment D is empty. there is no any apartment on the east of J and R and J lives on the same floor. So J lives on third floor of apartment D.
Step 4: Using the remaining conditions, J lives above E, O lives on the top floor of one of the given apartment but not in the apartment having four floors in it. O and E does not live in the same apartment. P live immediately above the vacant floor. hence, we get our final solution.

.