The largest number Alice can form is by placing max(A1,A2,A3)\max(A_1, A_2, A_3)max(A1,A2,A3) first; then the maximum of the remaining two digits next; and finally the last one.
This can also be seen as sorting the array [A1,A2,A3][A_1, A_2, A_3][A1,A2,A3] in descending order.
Bob’s largest number is similarly obtained by sorting [B1,B2,B3][B_1, B_2, B_3][B1,B2,B3] in descending order.
Once both players’ scores are known, compare them to see who wins, for example by using if conditions.