Trains the technique from
LeetCode 852Peak Index in a Mountain ArrayThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A pottery kiln writes down its chamber temperature once a minute for one firing cycle. The log is a single ramp: reading by reading the temperature climbs to one hottest minute, and from that minute onward it drops, reading by reading, until the cycle ends. No two neighbouring readings are ever equal, the climb is at least one minute long, and so is the drop, so the hottest minute is never the first or last entry.
You are given the log as readings. Return the position of the hottest reading, counting positions from 0.
Your routine must run in time logarithmic in the length of readings.
Example 1
Position 2 holds 910. The readings before it climb, 120 then 480, and the reading after it, 300, is lower.
Example 2
Position 1 holds 62, above the 15 that precedes it, and every later reading is below the one before it.
Example 3
The climb runs through positions 0 to 4 and the only drop is the final 299, so the hottest minute sits at position 4.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def kiln_ramp_peak(readings: list[int]) -> int:public int kilnRampPeak(int[] readings)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.