title: Need to solve python logical task
body: <pre><code>import datetime
  
  class Element(object):
      name: str
      datetime: datetime.datetime
      
      def __init__(self, *args, **kwargs):
          self.name = args[0]
          self.datetime = args[1]
          
      def __str__(self):
          return self.name + &quot; &quot; + self.datetime.strftime(&quot;%d-%m-%Y %H:%M:%S&quot;)
          
  e = Element(&quot;Name 1&quot;, datetime.datetime(2022, 1, 5, 20, 20, 20))
  e2 = Element(&quot;Name 1&quot;, datetime.datetime(2022, 1, 5, 20, 20, 23))
  e3 = Element(&quot;Name 2&quot;, datetime.datetime(2022, 2, 5, 19, 11, 10))
  e4 = Element(&quot;Name 3&quot;, datetime.datetime(2022, 3, 5, 10, 15, 10))
  e5 = Element(&quot;Name 3&quot;, datetime.datetime(2022, 3, 5, 10, 15, 8))
  e6 = Element(&quot;Name 4&quot;, datetime.datetime(2022, 4, 7, 12, 12, 8))
  e7 = Element(&quot;Name 4&quot;, datetime.datetime(2022, 4, 7, 12, 12, 20))
  
  array = [e, e2, e3, e4, e5, e6, e7]
  new_array = []
  </code></pre>
  <p>I need to generate a new array with this rule: there were no elements with the same name if they have a datetime difference of less than 5 seconds</p>