Which solution is better, faster and readable? : <p>ok, problem: "An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case."
 and I write 2 solutions  </p>

<p>First solution:</p>

<pre class="lang-java prettyprint-override"><code>Scanner scanner = new Scanner(System.in);
String string = scanner.next();
long start = System.currentTimeMillis();
char words[] = string.toCharArray();
boolean isIsogram=true;
for (int i=(words.length-1); i&gt;=0; i--){
  for(int j=0; j&lt;(i-1);j++){
    if(words[i]==words[j]){
      isIsogram=false;
    }
  }
}
long finish = System.currentTimeMillis();
System.out.println(isIsogram + " time:"+ (finish-start) );
</code></pre>

<p>Second solution:</p>

<pre class="lang-java prettyprint-override"><code>    Scanner scanner = new Scanner(System.in);
    String string = scanner.next();
    long start = System.currentTimeMillis();
    boolean isIsogram = (string.length() == string.toLowerCase().chars().distinct().count());
    long finish = System.currentTimeMillis();
    System.out.println(isIsogram + " time:"+ (finish-start) );
</code></pre>

<p>I have tested both solutions and there is results:
input: "asd" <br>
1) true time 0 <br>
2) true time 113 </p>

<p>and I want to know your ideas and opinion which solution is better?
My teacher told me 2 solution is better, but 1 solution takes 
less time, and I am not sure which is better.....</p>
