Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,31 @@ public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
System.out.print("Hello and welcome!");

for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}

if (isUnique("alwgys")) {
System.out.print("The word is unique");
} else {
System.out.print("The word is not unique!");
}
}

public static boolean isUnique(String word) {
for (int i = 0; i <= word.length()-1; i++) {
char a = word.charAt(i);
for(int j = i + 1 ; j <= word.length()-1; j++) {
if (word.charAt(j) == a) {
return false;
}
}
}
return true;
}

}