For 1st one:-
Case 1:- When 77 come with $91, 2,13,24$ i.e. before 12, 62. So, no of ways to arrange this is 120.
Case 2:- When 77 come between 12 and 62 then 91, 2, 13, 24 can be arranged in 24 ways, So, for this case 24 ways.
Case 3:- When 77 come after 12 and 62 then 91, 2, 13, 24 can be arranged in 24 ways, So, for this case 24 ways.
In total $120+ 24+ 24 = 168$ ways.