title: Python: first unique number in a list
body: <p>Just had an interview test where I had to find a first unique (non repeating) element in a list and return it. If no unique elements found, return -1. I was told my solution was not optimal. Can someone suggest a better method?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>def solution(lst):
      if len(lst) == 1:
          return lst[0]
      elif lst == []:
          return -1
      for i in lst:
          if lst.count(i) == 1:
              return i
      return -1
  </code></pre>