#Dayoon Kim, 2024-3-24, HW16 Help:=proc(): print(`qSR(q,INI,L,n)`): end: #HW16-1. (this code has error.. it always returns FAIL2..) qSR:=proc(q,INI,L,n) local r,i,M,ng: r:=nops(L): if nops(INI)<>L[-1][2] then RETURN(FAIL1): fi: if issubset(convert(INI,set),convert({seq(i,i=0..q-1)},set)) then RETURN(FAIL2): fi: if not (type(L,list) and {seq(type(L[i],list),i=1..nops(L))}={true} and sort([seq(L[i][2],i=1..nops(L))])=[seq(L[i][2],i=1..nops(L))]) then RETURN(FAIL3): fi: if not type(n,posint) then RETURN(FAIL4): fi: M:=INI: while(nops(M))