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
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
Binary file added src/main/java/.DS_Store
Binary file not shown.
Binary file added src/main/java/io/.DS_Store
Binary file not shown.
Binary file added src/main/java/io/zipcoder/StringsAndThings.class
Binary file not shown.
42 changes: 37 additions & 5 deletions src/main/java/io/zipcoder/StringsAndThings.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ public class StringsAndThings {
* countYZ("day fyyyz"); // Should return 2
*/
public Integer countYZ(String input){
return null;
String[] eachWord = input.split(" ");
int yZcounter = 0;
for (int i = 0; i < eachWord.length; i++) {
if (input.endsWith("y") || input.endsWith("z")) {
yZcounter++;
}
}
return yZcounter;
// return null;
}

/**
Expand All @@ -28,7 +36,8 @@ public Integer countYZ(String input){
* removeString("Hello there", "x") // Should return "Hello there"
*/
public String removeString(String base, String remove){
return null;

return base.replace(remove,"");
}

/**
Expand All @@ -40,7 +49,19 @@ public String removeString(String base, String remove){
* containsEqualNumberOfIsAndNot("noisxxnotyynotxisi") // Should return true
*/
public Boolean containsEqualNumberOfIsAndNot(String input){
return null;
int numOfIs = 0;
int numOfNot = 0;
for(int i = 0; i < input.length()-1; i++) {
if(input.substring(i, i+2).equals("is")) {
numOfIs++;
}
}
for(int i = 0; i < input.length()-2; i++) {
if(input.substring(i, i+3).equals("not")){
numOfNot++;
}
}
return (numOfIs == numOfNot);
}

/**
Expand All @@ -51,7 +72,12 @@ public Boolean containsEqualNumberOfIsAndNot(String input){
* gHappy("xxggyygxx") // Should return false
*/
public Boolean gIsHappy(String input){
return null;

for(int i = 0; i < input.length()-1; i++) {
if (input.substring(i, i + 2).equals("gg")) {
return true;
}
}return false;
}


Expand All @@ -63,6 +89,12 @@ public Boolean gIsHappy(String input){
* countTriple("a") // Should return 0
*/
public Integer countTriple(String input){
return null;
int tripleCounter = 0;
for(int i = 0; i < input.length()-2; i++) {
if (input.charAt(i) == input.charAt(i + 1) && input.charAt(i) == input.charAt(i + 2)) {
tripleCounter++;
}
}
return tripleCounter;
}
}
Binary file added target/classes/io/zipcoder/StringsAndThings.class
Binary file not shown.
5 changes: 5 additions & 0 deletions target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Sat Jul 02 13:39:17 EDT 2022
artifactId=strings-and-things
groupId=com.github.zipcodewilmington
version=1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Users/kendra/dev/StringsAndThings/src/main/java/io/zipcoder/StringsAndThings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/Users/kendra/dev/StringsAndThings/src/test/java/io/zipcoder/stringsandthings/RemoveStringTest.java
/Users/kendra/dev/StringsAndThings/src/test/java/io/zipcoder/stringsandthings/CountYZTest.java
/Users/kendra/dev/StringsAndThings/src/test/java/io/zipcoder/stringsandthings/GIsHappyTest.java
/Users/kendra/dev/StringsAndThings/src/test/java/io/zipcoder/stringsandthings/CountTripleTest.java
/Users/kendra/dev/StringsAndThings/src/test/java/io/zipcoder/stringsandthings/ContainsEqualNumberOfIsAndNotTest.java
Binary file added target/strings-and-things-1.0.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="3" failures="0" name="io.zipcoder.stringsandthings.ContainsEqualNumberOfIsAndNotTest" time="0" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="18.0.1.1+0"/>
<property name="sun.boot.library.path" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.vendor" value="Homebrew"/>
<property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="path.separator" value=":"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.compressedOopsMode" value="Zero based"/>
<property name="java.runtime.version" value="18.0.1.1+0"/>
<property name="os.arch" value="aarch64"/>
<property name="java.io.tmpdir" value="/var/folders/rw/1rnjc7b90vd_mr3753j04_s40000gp/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/kendra/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="maven.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="62.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="maven.test.failure.ignore" value="true"/>
<property name="os.version" value="12.1"/>
<property name="library.jansi.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/lib/jansi-native"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/kendra"/>
<property name="user.timezone" value="America/New_York"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="18"/>
<property name="user.name" value="kendra"/>
<property name="java.class.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/boot/plexus-classworlds-2.6.0.jar"/>
<property name="java.vm.specification.version" value="18"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher package -Dmaven.test.failure.ignore=true"/>
<property name="java.home" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home"/>
<property name="apple.awt.application.name" value="Launcher"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="18.0.1.1"/>
<property name="native.encoding" value="UTF-8"/>
<property name="java.vendor" value="Homebrew"/>
<property name="sun.stderr.encoding" value="UTF-8"/>
<property name="maven.home" value="/opt/homebrew/Cellar/maven/3.8.6/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2022-04-22"/>
<property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="sun.cpu.endian" value="little"/>
<property name="java.vendor.version" value="Homebrew"/>
<property name="sun.stdout.encoding" value="UTF-8"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
</properties>
<testcase classname="io.zipcoder.stringsandthings.ContainsEqualNumberOfIsAndNotTest" name="equalIsNotTest1" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.ContainsEqualNumberOfIsAndNotTest" name="equalIsNotTest2" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.ContainsEqualNumberOfIsAndNotTest" name="equalIsNotTest3" time="0"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="3" failures="0" name="io.zipcoder.stringsandthings.CountTripleTest" time="0" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="18.0.1.1+0"/>
<property name="sun.boot.library.path" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.vendor" value="Homebrew"/>
<property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="path.separator" value=":"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.compressedOopsMode" value="Zero based"/>
<property name="java.runtime.version" value="18.0.1.1+0"/>
<property name="os.arch" value="aarch64"/>
<property name="java.io.tmpdir" value="/var/folders/rw/1rnjc7b90vd_mr3753j04_s40000gp/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/kendra/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="maven.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="62.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="maven.test.failure.ignore" value="true"/>
<property name="os.version" value="12.1"/>
<property name="library.jansi.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/lib/jansi-native"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/kendra"/>
<property name="user.timezone" value="America/New_York"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="18"/>
<property name="user.name" value="kendra"/>
<property name="java.class.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/boot/plexus-classworlds-2.6.0.jar"/>
<property name="java.vm.specification.version" value="18"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher package -Dmaven.test.failure.ignore=true"/>
<property name="java.home" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home"/>
<property name="apple.awt.application.name" value="Launcher"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="18.0.1.1"/>
<property name="native.encoding" value="UTF-8"/>
<property name="java.vendor" value="Homebrew"/>
<property name="sun.stderr.encoding" value="UTF-8"/>
<property name="maven.home" value="/opt/homebrew/Cellar/maven/3.8.6/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2022-04-22"/>
<property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="sun.cpu.endian" value="little"/>
<property name="java.vendor.version" value="Homebrew"/>
<property name="sun.stdout.encoding" value="UTF-8"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
</properties>
<testcase classname="io.zipcoder.stringsandthings.CountTripleTest" name="countTripleTest1" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.CountTripleTest" name="countTripleTest2" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.CountTripleTest" name="countTripleTest3" time="0"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="3" failures="0" name="io.zipcoder.stringsandthings.CountYZTest" time="0" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="18.0.1.1+0"/>
<property name="sun.boot.library.path" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.vendor" value="Homebrew"/>
<property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="path.separator" value=":"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/kendra/dev/StringsAndThings"/>
<property name="java.vm.compressedOopsMode" value="Zero based"/>
<property name="java.runtime.version" value="18.0.1.1+0"/>
<property name="os.arch" value="aarch64"/>
<property name="java.io.tmpdir" value="/var/folders/rw/1rnjc7b90vd_mr3753j04_s40000gp/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/kendra/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="maven.conf" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="62.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="maven.test.failure.ignore" value="true"/>
<property name="os.version" value="12.1"/>
<property name="library.jansi.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/lib/jansi-native"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/kendra"/>
<property name="user.timezone" value="America/New_York"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="18"/>
<property name="user.name" value="kendra"/>
<property name="java.class.path" value="/opt/homebrew/Cellar/maven/3.8.6/libexec/boot/plexus-classworlds-2.6.0.jar"/>
<property name="java.vm.specification.version" value="18"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher package -Dmaven.test.failure.ignore=true"/>
<property name="java.home" value="/opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home"/>
<property name="apple.awt.application.name" value="Launcher"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="18.0.1.1"/>
<property name="native.encoding" value="UTF-8"/>
<property name="java.vendor" value="Homebrew"/>
<property name="sun.stderr.encoding" value="UTF-8"/>
<property name="maven.home" value="/opt/homebrew/Cellar/maven/3.8.6/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2022-04-22"/>
<property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="sun.cpu.endian" value="little"/>
<property name="java.vendor.version" value="Homebrew"/>
<property name="sun.stdout.encoding" value="UTF-8"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
</properties>
<testcase classname="io.zipcoder.stringsandthings.CountYZTest" name="countYZTest1" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.CountYZTest" name="countYZTest2" time="0"/>
<testcase classname="io.zipcoder.stringsandthings.CountYZTest" name="countYZTest3" time="0"/>
</testsuite>
Loading