According to me,
L1 should be CSL because it has 2 occurrences of x, which means whenever the x occurs a second time then it must be equivalent to the first x, which can be checked by LBA, (not by PDA because in PDA we use stack which uses LIFO approach, had it been wxyx^r then PDA can be used.) as here we will require 2 stacks to compare the values of x. FA won’t be able to store the first occurrence of x belonging to (0+1)* , so how would FA be able to check whether the first occurrence of x and second occurrence of x are similar or not? That’s why, I think L1 can’t be regular.
The approach which I can think of is, as we don’t need to worry about w and y , so we directly skip it without taking them into the stack. We have to only worry about x(1st occurrence) and x (2nd occurrence). We will use 2 stacks to compare them.
But this was a WRONG approach!
Instead, we have to think it like we have wxyx, where x is the one with the double occurrence, try to make its length as small as possible, after doing which we will get that x can be either 0 or 1. For rest we can assume that as w and y are altogether different, a certain part of x can be considered under w and y as even they both belong to (0+1)* . The place we need to take care is as x is present at the end, then the ending letter of wxyx would be equal to x and hence that same x’s value would be the value of the first occurrence of x. So, we can form a regular expression for it as shown by the best answer.