      p.incl s[i]
    <span class="hljs-keyword">block</span> findInvalid:
      <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> l ..&lt; s.len:
        n = s[i]
        <span class="hljs-keyword">block</span> findPair:
          <span class="hljs-keyword">for</span> m <span class="hljs-keyword">in</span> d:
            <span class="hljs-keyword">if</span> n != m <span class="hljs-keyword">and</span> n - m <span class="hljs-keyword">in</span> p: <span class="hljs-keyword">break<