ProgrammingModerateTCS NQT · Infosys
How many distinct strings can be formed by arranging the letters of AABB?
- A. 12
- B. 4
- C. 6
- D. 24
Correct answer: C. 6
Arranging 4 letters with two A and two B gives 4! / (2! * 2!) = 6 distinct strings. Dividing out the repeated letters avoids counting identical arrangements twice.
More C Programming questions
- How many disk moves does the optimal Tower of Hanoi solution need for 5 disks?
- How many binary strings of length 4 contain at least two adjacent 1s?
- How many subsets of {1, 2, ..., 10} have an even sum of elements? The empty set counts.
- The pairs (1,2), (3,5) and (2,5) are sorted by the second value descending, with ties broken by the first value ascending. Which pair…
- How many integers from 0 to 255 have exactly four 1 bits in binary?
- What is 0 ^ 1 ^ 2 ^ ... ^ 31, the XOR of all integers from 0 to 31?