Answer
The codeine hydrochloride solution has higher pH.
Work Step by Step
Cocaine:
$$K_b = 10^{-pKb} = 10^{-8.41} = 3.9 \times 10^{-9} $$
$$K_a (conj. acid)= \frac{1.0 \times 10^{-14}}{K_b} = \frac{1.0 \times 10^{-14}}{ 3.9 \times 10^{-9} } = 2.6 \times 10^{-6} $$
Codeine:
$$K_b = 10^{-pKb} = 10^{-7.95} = 1.1 \times 10^{-8} $$
$$K_a(conj. acid) = \frac{1.0 \times 10^{-14}}{K_b} = \frac{1.0 \times 10^{-14}}{ 1.1 \times 10^{-8} } = 9.1 \times 10^{-7} \space$$
Codeine hydrochloride has the lower $K_a$, thus, the lower $H_3O^+$ concentration in solution, which means higher pH.