Logical Programming Problem
<p>I've been trying to solve this problem for quite sometime but I am having trouble with it.</p>

<p>Let's say on a trigger, you receive values.</p>

<pre><code>First trigger: You get 1 
Second trigger: You get 1, 2
Third trigger: You get 1, 2, 3
</code></pre>

<p>So, I store 1.
For 2nd trigger, I store 2 since 1 already exist.
For 3rd trigger, I store 3 since 1,2 already exist</p>

<p>so in total I have stored 1,2,3</p>

<p>As you can see, we can easily check for new values, if old != new.</p>

<p>Here's come the problem:</p>

<pre><code>Fourth trigger: You get 1, 2, 4
</code></pre>

<p>For 4th trigger, I store 1, 2 because it exists
but how do I check against 3 and remove 3 from store and check if 4 is new?</p>

<p>If you are having problems understanding this, feel free to clarify. Thanks!</p>
