<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""></div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">import</b></span>&nbsp;UIKit</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// here are the inputs</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(28, 0, 207); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(15, 104, 160);">inputInts</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= [</span>72<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>111<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>63<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>85<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>61<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>56<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>118<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>121<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>61<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>69<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>63<span class="" style="color: rgba(0, 0, 0, 0.85);">,</span>61<span class="" style="color: rgba(0, 0, 0, 0.85);">]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #1</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span>&nbsp;<span class="" style="color: rgb(15, 104, 160);">sum</span>&nbsp;=&nbsp;<span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;number&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">inputInts</span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">sum</span>&nbsp;<span class="" style="color: rgb(108, 54, 169);">+=</span>&nbsp;number</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #1 - Sum of inputs is:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">sum</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #2</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>average<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;:</span><span class="" style="color: rgb(57, 0, 160);">Float</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0.0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);">average<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Float</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>sum<span class="" style="color: rgba(0, 0, 0, 0.85);">)&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">/</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Float</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">.</span><span class="" style="color: rgb(108, 54, 169);">count</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>averageInt<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;:</span><span class="" style="color: rgb(57, 0, 160);">Int</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Int</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span><span class="" style="color: rgb(50, 109, 116);">average</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// ceil is like rounding but forced up</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(15, 104, 160);">averageRemainder</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Int</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span><span class="" style="color: rgb(108, 54, 169);">ceil</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span><span class="" style="color: rgb(57, 0, 160);">Float</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">.</span><span class="" style="color: rgb(108, 54, 169);">count</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">*</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;(</span>average<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">-</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Float</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>averageInt<span class="" style="color: rgba(0, 0, 0, 0.85);">))))</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #2 - Average of inputs is:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">averageInt</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>,&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">averageRemainder</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #3</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>arrayOfEvens<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= [</span><span class="" style="color: rgb(57, 0, 160);">Int</span><span class="" style="color: rgba(0, 0, 0, 0.85);">]()</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;number&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">inputInts</span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span>&nbsp;((<span class="" style="color: rgb(57, 0, 160);">Int</span>(number&nbsp;<span class="" style="color: rgb(108, 54, 169);">/</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">2</span>)&nbsp;<span class="" style="color: rgb(108, 54, 169);">*</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">2</span>)&nbsp;<span class="" style="color: rgb(108, 54, 169);">==</span>&nbsp;number) {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">arrayOfEvens</span>.<span class="" style="color: rgb(108, 54, 169);">append</span>(number)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #3 - Even numbers:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">arrayOfEvens</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #4</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>largest<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>largestPosition<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;n&nbsp;</span><span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgb(108, 54, 169);">..&lt;</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">.</span><span class="" style="color: rgb(108, 54, 169);">count</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;{</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp;&nbsp;</span><span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[n]&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">&gt;</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>largest<span class="" style="color: rgba(0, 0, 0, 0.85);">) {</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>largest<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[n]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>largestPosition<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= n</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// print("largest is \(largest) at position \(largestPosition)")</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>smallest<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(50, 109, 116);">largest</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>smallestPosition<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;n&nbsp;</span><span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgb(108, 54, 169);">..&lt;</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">.</span><span class="" style="color: rgb(108, 54, 169);">count</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;{</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp;&nbsp;</span><span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[n]&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">&lt;</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>largest<span class="" style="color: rgba(0, 0, 0, 0.85);">) {</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>smallest<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[n]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>smallestPosition<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= n</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #4 - Smallest is&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">smallest</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>&nbsp;in position&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">smallestPosition</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #5</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span>&nbsp;<span class="" style="color: rgb(15, 104, 160);">repeats</span>&nbsp;= [<span class="" style="color: rgb(57, 0, 160);">Int</span>]()</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>repeatsTotalCount<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>alreadyFoundThese<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= [</span><span class="" style="color: rgb(57, 0, 160);">Int</span><span class="" style="color: rgba(0, 0, 0, 0.85);">]()</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;lookingFor&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">inputInts</span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span>&nbsp;(<span class="" style="color: rgb(50, 109, 116);">alreadyFoundThese</span>.<span class="" style="color: rgb(108, 54, 169);">contains</span>(lookingFor)) {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>// nothing to do if we've already found it once</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">else</b></span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span>&nbsp;count =&nbsp;<span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;thisPosition&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">inputInts</span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span>&nbsp;(thisPosition&nbsp;<span class="" style="color: rgb(108, 54, 169);">==</span>&nbsp;lookingFor) {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count&nbsp;<span class="" style="color: rgb(108, 54, 169);">+=</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">1</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span>&nbsp;(count&nbsp;<span class="" style="color: rgb(108, 54, 169);">&gt;</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">1</span>) {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">_</b></span>&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgb(108, 54, 169);">..&lt;</span>count {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">repeats</span>.<span class="" style="color: rgb(108, 54, 169);">append</span>(lookingFor)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">repeatsTotalCount</span>&nbsp;<span class="" style="color: rgb(108, 54, 169);">+=</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">1</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">alreadyFoundThese</span>.<span class="" style="color: rgb(108, 54, 169);">append</span>(lookingFor)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #5 - Number of repeats:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">repeatsTotalCount</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>&nbsp;consisting of:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">repeats</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #6</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// Ok the idea of laying down the two input numbers as a line of bits, end to end, then treating the pile of bits as another format by grouping them in a differen way is very cool .. but I had to google this one like crazy !!</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);">inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgba(0, 0, 0, 0.85);">]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">let</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(15, 104, 160);">firstInt</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Int8</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgba(0, 0, 0, 0.85);">])</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">let</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>secondInt<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(57, 0, 160);">Int8</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span><span class="" style="color: rgb(50, 109, 116);">inputInts</span><span class="" style="color: rgba(0, 0, 0, 0.85);">[</span><span class="" style="color: rgb(28, 0, 207);">1</span><span class="" style="color: rgba(0, 0, 0, 0.85);">])</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">let</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>loopValues<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= [</span><span class="" style="color: rgb(28, 0, 207);">1</span><span class="" style="color: rgba(0, 0, 0, 0.85);">,</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgba(0, 0, 0, 0.85);">]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">func</b></span>&nbsp;<span class="" style="color: rgb(15, 104, 160);">load16</span>(incomingArray: [<span class="" style="color: rgb(57, 0, 160);">UInt8</span>]) -&gt;&nbsp;<span class="" style="color: rgb(57, 0, 160);">UInt16</span>{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span>&nbsp;u:&nbsp;<span class="" style="color: rgb(57, 0, 160);">UInt16</span>&nbsp;=&nbsp;<span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;index&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">loopValues</span>&nbsp;{</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; u = u&nbsp;<span class="" style="color: rgb(108, 54, 169);">&lt;&lt;</span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">8</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(108, 54, 169);">print</span>&nbsp;(u)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; u = u&nbsp;<span class="" style="color: rgb(108, 54, 169);">|</span>&nbsp;<span class="" style="color: rgb(57, 0, 160);">UInt16</span>(incomingArray[index])</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(108, 54, 169);">print</span>&nbsp;(u)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">return</b></span>&nbsp;u</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(15, 104, 160);">intsToCombine</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;= [</span><span class="" style="color: rgb(57, 0, 160);">UInt8</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[</span><span class="" style="color: rgb(28, 0, 207);">1</span><span class="" style="color: rgba(0, 0, 0, 0.85);">]),</span><span class="" style="color: rgb(57, 0, 160);">UInt8</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>inputInts<span class="" style="color: rgba(0, 0, 0, 0.85);">[</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgba(0, 0, 0, 0.85);">])]</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span>&nbsp;<span class="" style="color: rgb(15, 104, 160);">resultInt16</span>&nbsp;=&nbsp;<span class="" style="color: rgb(50, 109, 116);">load16</span>(incomingArray:&nbsp;<span class="" style="color: rgb(50, 109, 116);">intsToCombine</span>)</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #6 - New number is:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">resultInt16</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #7</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>sortArray<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(50, 109, 116);">inputInts</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>neededToSwapStuff<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">1</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(15, 104, 160); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">var</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span>totalSortActions<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(155, 35, 147);"><b class="">while</b></span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;(</span>neededToSwapStuff<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">&gt;</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgba(0, 0, 0, 0.85);">) {</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp;&nbsp;</span>neededToSwapStuff<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;=&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">0</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">for</b></span>&nbsp;number&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">in</b></span>&nbsp;<span class="" style="color: rgb(28, 0, 207);">0</span><span class="" style="color: rgb(108, 54, 169);">..&lt;</span>(<span class="" style="color: rgb(50, 109, 116);">sortArray</span>.<span class="" style="color: rgb(108, 54, 169);">count-</span><span class="" style="color: rgb(28, 0, 207);">1</span>) {</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">if</b></span>&nbsp;(<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number]&nbsp;<span class="" style="color: rgb(108, 54, 169);">&gt;</span>&nbsp;<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number<span class="" style="color: rgb(108, 54, 169);">+</span><span class="" style="color: rgb(28, 0, 207);">1</span>]){</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>neededToSwapStuff<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">+=</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">1</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);"><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>totalSortActions<span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(108, 54, 169);">+=</span><span class="" style="color: rgba(0, 0, 0, 0.85);">&nbsp;</span><span class="" style="color: rgb(28, 0, 207);">1</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(155, 35, 147);"><b class="">let</b></span>&nbsp;numberBeingMoved =&nbsp;<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number]</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number] =&nbsp;<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number<span class="" style="color: rgb(108, 54, 169);">+</span><span class="" style="color: rgb(28, 0, 207);">1</span>]</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(50, 109, 116);">sortArray</span>[number<span class="" style="color: rgb(108, 54, 169);">+</span><span class="" style="color: rgb(28, 0, 207);">1</span>] = numberBeingMoved</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">&nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">}</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(108, 54, 169);">print</span><span class="" style="color: rgba(0, 0, 0, 0.85);">(</span>"Output #7 - Input 'ints' were sorted to&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">sortArray</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>&nbsp;in:&nbsp;<span class="" style="color: rgba(0, 0, 0, 0.85);">\(</span><span class="" style="color: rgb(50, 109, 116);">totalSortActions</span><span class="" style="color: rgba(0, 0, 0, 0.85);">)</span>&nbsp;actions"<span class="" style="color: rgba(0, 0, 0, 0.85);">)</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// working on Output #8</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// the 11th value (118) was missing from the sorted sring in the coding_challenge1 file .. made this very interesting</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255); min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">// still stuck here .. thinking the 11th value was omitted and should be in the set for full comprehension as 118 corresponds to the lower case 'v' in ascii.</div></div></div></body></html>