Difficulty: Medium
Correct Answer: 9
Explanation:
Introduction / Context:
This problem tests careful indexing and stable, pairwise swaps. We take the 10-digit sequence 5904627813 and swap positions in fixed pairs: (1↔6), (2↔7), (3↔8), (4↔9), (5↔10). Then we must read the fourth digit from the right of the resulting string.
Given Data / Assumptions:
Concept / Approach:
Perform the swaps carefully without cascading errors (treat swaps as simultaneous or track in a copy). After the final arrangement, identify the 4th from right. Alternatively, compute that “4th from right” equals index 10−4+1 = 7 from the left.
Step-by-Step Solution:
Verification / Alternative check:
Count from the right: (1)6, (2)4, (3)0, (4)9 → same result.
Why Other Options Are Wrong:
Common Pitfalls:
Applying swaps in-place in a way that uses already-swapped values; miscounting “4th from right”; or indexing from zero. Work with a copied array or treat swaps as simultaneous.
Final Answer:
9
Discussion & Comments