From 9a281c50e40c1e10c0b19166d38097ac40addf29 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:01:45 -0800 Subject: [PATCH 1/6] Testing Commit --- src/Main.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 930198c..a62d016 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,10 +1,12 @@ +import java.util.HashSet; + //TIP To Run code, press or // click the icon in the gutter. public class Main { public static void main(String[] args) { //TIP Press with your caret at the highlighted text // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); + System.out.printf("Hello and welcome!\n"); for (int i = 1; i <= 5; i++) { //TIP Press to start debugging your code. We have set one breakpoint @@ -12,4 +14,13 @@ public static void main(String[] args) { System.out.println("i = " + i); } } + public static boolean isUnique(String inputString) + { + //HashSet textString = new HashSet(); + //for(int i = 0; i < inputString.length(); i++) + //{ + + //} + return true; + } } \ No newline at end of file From 00296878f9f0213202c697ea0cd983b9a221cd79 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:11:17 -0800 Subject: [PATCH 2/6] isUnique is running. --- src/Main.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Main.java b/src/Main.java index a62d016..684eb70 100644 --- a/src/Main.java +++ b/src/Main.java @@ -7,6 +7,8 @@ public static void main(String[] args) { //TIP Press with your caret at the highlighted text // to see how IntelliJ IDEA suggests fixing it. System.out.printf("Hello and welcome!\n"); + System.out.println("Is 'test' unique: " + isUnique("test")); + System.out.println("is 'steak' unique: "+ isUnique("steak")); for (int i = 1; i <= 5; i++) { //TIP Press to start debugging your code. We have set one breakpoint @@ -16,11 +18,12 @@ public static void main(String[] args) { } public static boolean isUnique(String inputString) { - //HashSet textString = new HashSet(); - //for(int i = 0; i < inputString.length(); i++) - //{ - - //} + HashSet testString = new HashSet(); + for(int i = 0; i < inputString.length(); i++) + { + if (!(testString.add(inputString.charAt(i)))) + return false; + } return true; } } \ No newline at end of file From fe906d2968b0cb3e41e888265e203518d3c073a9 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:13:59 -0800 Subject: [PATCH 3/6] isUnique is running. --- src/Main.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Main.java b/src/Main.java index 684eb70..5d7c3d7 100644 --- a/src/Main.java +++ b/src/Main.java @@ -6,15 +6,9 @@ public class Main { public static void main(String[] args) { //TIP Press with your caret at the highlighted text // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!\n"); + System.out.println("Hello and welcome!\n"); System.out.println("Is 'test' unique: " + isUnique("test")); System.out.println("is 'steak' unique: "+ isUnique("steak")); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i = " + i); - } } public static boolean isUnique(String inputString) { From 1a0affa68cc8200b018dd17dfcce1c2d99d6e597 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:17:19 -0800 Subject: [PATCH 4/6] isUnique is running. --- src/Main.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Main.java b/src/Main.java index 5d7c3d7..7f807ef 100644 --- a/src/Main.java +++ b/src/Main.java @@ -15,6 +15,7 @@ public static boolean isUnique(String inputString) HashSet testString = new HashSet(); for(int i = 0; i < inputString.length(); i++) { + //still need to check format before add. if (!(testString.add(inputString.charAt(i)))) return false; } From 25ed521478c276fa64fc16c85636f29d13a57586 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:17:47 -0800 Subject: [PATCH 5/6] isUnique is running. --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 7f807ef..6be24e6 100644 --- a/src/Main.java +++ b/src/Main.java @@ -12,7 +12,7 @@ public static void main(String[] args) { } public static boolean isUnique(String inputString) { - HashSet testString = new HashSet(); + HashSet testString = new HashSet(); //maybe not hashSet? for(int i = 0; i < inputString.length(); i++) { //still need to check format before add. From aa8e706267128f48144235f5074af8b66dfc4a49 Mon Sep 17 00:00:00 2001 From: EBoydGRC Date: Tue, 9 Jan 2024 10:19:02 -0800 Subject: [PATCH 6/6] isUnique is running. --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 6be24e6..f70f1de 100644 --- a/src/Main.java +++ b/src/Main.java @@ -12,7 +12,7 @@ public static void main(String[] args) { } public static boolean isUnique(String inputString) { - HashSet testString = new HashSet(); //maybe not hashSet? + HashSet testString = new HashSet(); //Maybe not hashSet? for(int i = 0; i < inputString.length(); i++) { //still need to check format before add.