Pregunta de entrevista de Granicus

Create an algorithm that takes in a string and returns 'true' if there are no repeating characters in the string, and false if there are repeating characters.

Respuesta de la entrevista

Anónimo

27 jul 2016

for(char b : a.toCharArray()) { a = a.substring(1); for(char c : a.toCharArray()) if(b == c) return false; } return true;