Here, Question should specify this code section is executed by Process Pi. At first look it creates confusion.
code for Process Pi:
L1:repeat
L2: flag[i] = true;
L3: turn = j;
L4: while (flag[j]==True && turn==j) // becoz you are the one who sets turn variable to j
do no-op; // if other process is interested then you should wait.
L5: Enter critical section, perform actions, then
L6: exit critical section
L7: Flag[i] = false;
L8: Perform other non-critical section actions.
L9:Until false;
Similarly code for Pj:
L1:repeat
L2: flag[j] = true;
L3: turn = i;
L4: while (flag[i]==True && turn==i) // becoz you are the one who sets turn variable to j
do no-op; // if other process is interested then you should wait.
L5: Enter critical section, perform actions, then
L6: exit critical section
L7: Flag[j] = false;
L8: Perform other non-critical section actions.
L9:Until false;
This way solution ensures mutual exclusion. Hence option (b) is correct answer.