Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>If we analyze it seems set size should be 8 which is the size of the array. But if you ran this program it prints 14. What's going on? Any idea?</p> </blockquote> <p>Just trace info</p> <pre><code>1 : 786 - 786 = 0 (new one 1 ) 2 : 786 - 678 = 108 (new one 2 ) 3 : 786 - 567 = 219 (new one 3 ) 4 : 786 - 456 = 330 (new one 4 ) 5 : 786 - 345 = 441 (new one 5 ) 6 : 786 - 234 = 552 (new one 6 ) 7 : 786 - 123 = 663 (new one 7 ) 8 : 786 - 10 = 776 (new one 8 ) 9 : 678 - 678 = 0 (already contained) 10 : 678 - 567 = 111 (new one 9 ) 11 : 678 - 456 = 222 (new one 10 ) 12 : 678 - 345 = 333 (new one 11 ) 13 : 678 - 234 = 444 (new one 12 ) 14 : 678 - 123 = 555 (new one 13 ) 15 : 678 - 10 = 668 (new one 14 ) 16 : 567 - 567 = 0 (already contained) 17 : 567 - 456 = 111 (already contained) 18 : 567 - 345 = 222 (already contained) 19 : 567 - 234 = 333 (already contained) 20 : 567 - 123 = 444 (already contained) 21 : 567 - 10 = 557 (new one 15 ) 22 : 456 - 456 = 0 (already contained) 23 : 456 - 345 = 111 (already contained) 24 : 456 - 234 = 222 (already contained) 25 : 456 - 123 = 333 (already contained) 26 : 456 - 10 = 446 (new one 16 ) 27 : 345 - 345 = 0 (already contained) 28 : 345 - 234 = 111 (already contained) 29 : 345 - 123 = 222 (already contained) 30 : 345 - 10 = 335 (new one 17 ) 31 : 234 - 234 = 0 (already contained) 32 : 234 - 123 = 111 (already contained) 33 : 234 - 10 = 224 (new one 18 ) 34 : 123 - 123 = 0 (already contained) 35 : 123 - 10 = 113 (new one 19 ) 36 : 10 - 10 = 0 (already contained) </code></pre> <p>Also, debugger is a great thing in cases when you can't analyze program's behavior ;)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload