<p>You are given a stream of <strong>records</strong> about a particular stock. Each record contains a <strong>timestamp</strong> and the corresponding <strong>price</strong> of the stock at that timestamp.</p>
<p>Unfortunately due to the volatile nature of the stock market, the records do not come in order. Even worse, some records may be incorrect. Another record with the same timestamp may appear later in the stream <strong>correcting</strong> the price of the previous wrong record.</p>
<p>Design an algorithm that:</p>
<ul>
<li><strong>Updates</strong> the price of the stock at a particular timestamp, <strong>correcting</strong> the price from any previous records at the timestamp.</li>
<li>Finds the <strong>latest price</strong> of the stock based on the current records. The <strong>latest price</strong> is the price at the latest timestamp recorded.</li>
<li>Finds the <strong>maximum price</strong> the stock has been based on the current records.</li>
<li>Finds the <strong>minimum price</strong> the stock has been based on the current records.</li>
</ul>
<p>Implement the <code>StockPrice</code> class:</p>
<ul>
<li><code>StockPrice()</code> Initializes the object with no price records.</li>
<li><code>void update(int timestamp, int price)</code> Updates the <code>price</code> of the stock at the given <code>timestamp</code>.</li>
<li><code>int current()</code> Returns the <strong>latest price</strong> of the stock.</li>
<li><code>int maximum()</code> Returns the <strong>maximum price</strong> of the stock.</li>
<li><code>int minimum()</code> Returns the <strong>minimum price</strong> of the stock.</li>
<li>At most <code>10<sup>5</sup></code> calls will be made <strong>in total</strong> to <code>update</code>, <code>current</code>, <code>maximum</code>, and <code>minimum</code>.</li>
<li><code>current</code>, <code>maximum</code>, and <code>minimum</code> will be called <strong>only after</strong><code>update</code> has been called <strong>at least once</strong>.</li>