Find Minimum Possible difference between numbers with unknown digits : <p>I have some cases as follows.</p>

<ul>
<li>1? 2?</li>
<li>?2? ??3</li>
<li>? ?</li>
<li>?5 ?0</li>
</ul>

<p>Now what I am supposed to do is to find some values in place of question marks, that would give produce the minimum possible difference between the 2 numbers.</p>

<p>Answers Should be like</p>

<ul>
<li><p>19 20 </p></li>
<li><p>023 023</p></li>
<li><p>0 0</p></li>
<li><p>05 00</p></li>
</ul>

<p>Note : the number which will be produced after the minimum absolute difference between the 2 values must be smallest. As in, the last case could be 15 and 10 with the absolute difference to be 5 but it is invalid.</p>

<p>I tried some permutation combination ideas for replacing the question marks for both numbers individually and then find out the number but the length of the number could go up to 18 digits per number. Hence I believe it wouldn't be a good idea.</p>

<p>Then I tried to search for similar questions but that didn't help.
I still think that <code>regex</code> could be helpful to solve this question but am stuck with how to do it. </p>

<p>Any help is welcome!! Thanx!</p>

<p>The language shall be Php.. I am working with Php.</p>
