public class PasswordData
{
    public PasswordData (PasswordPolicy policy, String password)
    {
        _policy = policy;
        _pwd = password;
    }

    public boolean valid ()
    {
        if (_pwd.indexOf(_policy.letter()) != -1)
        {
            char[] asArray = _pwd.toCharArray();
            int count = 0;

            for (int i = 0; i < asArray.length; i++)
            {
                if (asArray[i] == _policy.letter())
                    count++;
            }

            if ((count >= _policy.minumum()) && (count <= _policy.maximum()))
                return true;
        }

        return false;
    }

    @Override
    public String toString ()
    {
        return _policy.toString()+"\n"+"Password: "+_pwd;
    }

    private PasswordPolicy _policy;
    private String _pwd;
}
@@ -195,16 +195,17 @@
      if 
+(
 (_pwd.in
@@ -234,16 +234,36 @@
 ) != -1)
+ && _policy.valid())
 %0A       
@@ -314,16 +314,17 @@
 rray();%0A
+%0A
         
@@ -332,122 +332,95 @@
    i
-nt count = 0;%0A%0A            for (int i = 0; i %3C asArray.length; i++)%0A            %7B%0A                if (asArray%5Bi%5D =
+f ((asArray%5B_policy.first() -1%5D == _policy.letter()) && (asArray%5B_policy.second() -1%5D !
 = _p
@@ -438,77 +438,58 @@
 r())
-%0A                    count++;%0A            %7D%0A%0A            if ((count %3E
+ %7C%7C%0A                (asArray%5B_policy.first() -1%5D !
 = _p
@@ -498,23 +498,22 @@
 icy.
-minumum
+letter
 ()) && (
 coun
@@ -512,15 +512,38 @@
 && (
-count %3C
+asArray%5B_policy.second() -1%5D =
 = _p
@@ -552,15 +552,14 @@
 icy.
-maximum
+letter
 ()))
@@ -561,24 +561,32 @@
 r()))%0A      
+      %7B%0A
           re
@@ -579,24 +579,30 @@
 %7B%0A          
+      
 return true;
@@ -602,16 +602,30 @@
 n true;%0A
+            %7D%0A
         

Update PasswordData.java