Question: I only need to show the span if the user input value is greater than 1 and the input field doesn't contains the values defined in the regular expression.

Code:

```
<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Example - example-ng-form-production</title>

  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-animate.js"></script>

  <script type="text/javascript">
    angular.element(document.getElementsByTagName('head')).append(angular.element('<base href="' + window.location.pathname + '" />'));
  </script>
</head>

<body ng-app="formExample">
  <script>
    angular.module('formExample', [])
      .controller('FormController', ['$scope', function($scope) {
        $scope.userType = '';
        $scope.regex = "#%<;'=";
      }]);
  </script>
  <form name="myForm" ng-controller="FormController" class="my-form">
    userType:
    <input name="input" ng-model="userType" ng-pattern="regex && userType">
    <span ng-show="userType && myForm.input.$valid">show me!</span>
    <br>
  </form>
</body>

</html>

```

[Plunker Demo](https://plnkr.co/edit/xs2beXGoSnHUiIRG4DKw?p=preview)

Answer: 
Your solution is slow because you're not taking advantage of python's data structures. 

Here's a solution that collects results in a dict:

```
class Solution:
    def anagrams(self, strs):
        d = {}
        for word in strs:
            key = tuple(sorted(word))
            try:
                d[key].append(word)
            except KeyError:
                d[key] = [word]
        return [w for ws in d.values() for w in ws if len(ws) > 1]

```
As an addition to @Mike's great answer, here is a nice Pythonic way to do it:

```
import collections

class Solution:
    # @param strs: A list of strings
    # @return: A list of strings
    def anagrams(self, strs):
        patterns = Solution.find_anagram_words(strs)
        return [word for word in strs if ''.join(sorted(word)) in patterns]

    @staticmethod
    def find_anagram_words(strs):
        anagrams = collections.Counter(''.join(sorted(word)) for word in strs)
        return {word for word, times in anagrams.items() if times > 1}

```