Step 1: Read the pattern in the question.
Species A and B are sister species (closest living relatives), and their current ranges do not overlap: A holds the lower slopes up to 1800 m, and B takes over from 1800 m to 3500 m. Together, the two species cover the full elevational gradient with a single shared boundary at 1800 m.
Step 2: Recall the modes of speciation.
Sympatric speciation happens without any spatial separation, inside the same geographic range. Allopatric speciation needs the ancestral population to be split by a geographic barrier (a river, a mountain ridge, a stretch of unsuitable habitat) into two isolated populations that then diverge. Parapatric speciation happens when populations stay in contact along a shared boundary or a cline and diverge because of a strong environmental gradient, without ever being fully isolated. Peripatric speciation is a special case of allopatric speciation where a small population becomes isolated at the edge of the parent range and diverges rapidly because of its small size.
Step 3: Work out why the present-day picture looks parapatric but is not.
On a map, A and B sit side by side with a clean line at 1800 m, and that can look like an ongoing parapatric split. But in the Himalaya, this kind of elevational replacement between sister species is well documented, from long-term field studies on Himalayan birds, to be a leftover of past geographic isolation rather than an active split happening along the slope today. During the repeated climatic swings of the Pleistocene, ancestral populations were pushed apart into separate valleys or refugia with no gene flow between them. While isolated, they built up enough genetic difference to become distinct species. Only afterward did their ranges expand back out and meet again, producing the clean elevational boundary seen now.
Step 4: Rule out the other options.
Sympatric speciation is ruled out because it needs divergence with no spatial separation at all, and here the two forms occupy different places. Parapatric speciation is ruled out for the reason above: the boundary is a secondary contact zone from populations that diverged while apart, not an active divergence happening across the gradient right now. Peripatric speciation would need one of the two populations to have started as a small, marginal, founder population at the edge of the other's range, which the question does not indicate.
Final Answer:
The elevational replacement of species A and B is best explained as the outcome of speciation that took place while their ancestors were geographically isolated.
\[ \boxed{\text{Allopatric speciation}} \]