If it value is greater than min value than iterate the loop upto first min value index and simply print it index value .
else { for ( int i = 0 ; i < min ; i ++ ) Console . Write ( index ) ; Console . Write ( index ) ; } }