⚖️ LSAT Exam Prep

In a coding problem, 4 variables — a, b, c, d — must be initialized in order. c depends on a. d depends on b and c. b has no dependencies. a has no dependencies. What is a valid initialization order?

A a, b, c, d
B b, a, c, d
C a, c, b, d
D All of the above

✓ Correct Answer: Option D

a and b: no deps (can go first). c depends on a (after a). d depends on b and c (after both). A: a,b,c,d ✓. B: b,a,c,d ✓. C: a,c,b,d → d after both b and c ✓, c after a ✓. All valid.

Related LSAT Exam Prep Questions