<p>A <strong>sentence</strong> is a string of single-space separated words where each word can contain digits, lowercase letters, and the dollar sign <code>'$'</code>. A word represents a <strong>price</strong> if it is a sequence of digits preceded by a dollar sign.</p>
<ul>
<li>For example, <code>"$100"</code>, <code>"$23"</code>, and <code>"$6"</code> represent prices while <code>"100"</code>, <code>"$"</code>, and <code>"$1e5"</code> do not.</li>
</ul>
<p>You are given a string <code>sentence</code> representing a sentence and an integer <code>discount</code>. For each word representing a price, apply a discount of <code>discount%</code> on the price and <strong>update</strong> the word in the sentence. All updated prices should be represented with <strong>exactly two</strong> decimal places.</p>
<p>Return <em>a string representing the modified sentence</em>.</p>
<p>Note that all prices will contain <strong>at most</strong><code>10</code> digits.</p>
<strong>Input:</strong> sentence = "there are $1 $2 and 5$ candies in the shop", discount = 50
<strong>Output:</strong>"there are $0.50 $1.00 and 5$ candies in the shop"
<strong>Explanation:</strong>
The words which represent prices are "$1" and "$2".
- A 50% discount on "$1" yields "$0.50", so "$1" is replaced by "$0.50".
- A 50% discount on "$2" yields "$1". Since we need to have exactly 2 decimal places after a price, we replace "$2" with "$1.00".