AC In RRFRNDS

when I Solved This Problem using String Matrix I Got WA But When I Used BitSet Instead Of String Matrix Then I Got Ac Here Is Two Links Please Tell Me Why It Is Happening

Got WA

Got Ac

//