Advertisement
mihaellan

Untitled

Nov 12th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public static boolean doubleLetters(String word) {
  2.  
  3. char[] wordArr = word.toCharArray();
  4.  
  5. for (int i = 0; i < word.length(); i++) {
  6. for (int j = i + 1; j < wordArr.length; j++) {
  7. if (word.charAt(i) == wordArr[j]) {
  8. return true;
  9. }
  10. }
  11. }
  12. return false;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement