Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
17 changes: 15 additions & 2 deletions src/main/java/io/zipcoder/StringsAndThings.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ public class StringsAndThings {
* countYZ("day fyyyz"); // Should return 2
*/
public Integer countYZ(String input){
return null;
int letterCounter = 0; // we made a counter for the loop
String[] words = input.split(" "); // made a new string array, called words. made up of the string 'input'. split up based on spaces
for (String w: words) { // words = ["fez", "day"]
int n = w.length(); // made a new string called w. something with the array called words. for each value
if (w.charAt(n - 1) == 'Y' || w.charAt(n - 1) == 'Z') ; // of the array called words, we have a string called w. w is "fez", w is "day"
letterCounter++; // made an integer called n that is set to the length of the string w. (length of w is 3, for fez)
} // which comes from the values of the array called words
// if the character at the end of the string called w(the string "fez"), is equal to the char 'Y'
// or 'Z', increase the letter counter
// return the letter counter.

return letterCounter;
}

/**
Expand All @@ -27,7 +38,9 @@ public Integer countYZ(String input){
* removeString("Hello there", "e") // Should return "Hllo thr"
* removeString("Hello there", "x") // Should return "Hello there"
*/
public String removeString(String base, String remove){
public String removeString(String base, String remove) {


return null;
}

Expand Down
Binary file added target/classes/io/zipcoder/StringsAndThings.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.