From d525d09beced557907690338533b235281967317 Mon Sep 17 00:00:00 2001 From: smartist17 <79124739+smartist17@users.noreply.github.com> Date: Mon, 8 Mar 2021 22:25:40 -0500 Subject: [PATCH] Work in progress --- .../java/io/zipcoder/StringsAndThings.java | 17 +++++++++++++++-- .../classes/io/zipcoder/StringsAndThings.class | Bin 0 -> 1405 bytes .../ContainsEqualNumberOfIsAndNotTest.class | Bin 0 -> 1323 bytes .../stringsandthings/CountTripleTest.class | Bin 0 -> 1321 bytes .../stringsandthings/CountYZTest.class | Bin 0 -> 1372 bytes .../stringsandthings/GIsHappyTest.class | Bin 0 -> 1210 bytes .../stringsandthings/RemoveStringTest.class | Bin 0 -> 1308 bytes 7 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 target/classes/io/zipcoder/StringsAndThings.class create mode 100644 target/test-classes/io/zipcoder/stringsandthings/ContainsEqualNumberOfIsAndNotTest.class create mode 100644 target/test-classes/io/zipcoder/stringsandthings/CountTripleTest.class create mode 100644 target/test-classes/io/zipcoder/stringsandthings/CountYZTest.class create mode 100644 target/test-classes/io/zipcoder/stringsandthings/GIsHappyTest.class create mode 100644 target/test-classes/io/zipcoder/stringsandthings/RemoveStringTest.class diff --git a/src/main/java/io/zipcoder/StringsAndThings.java b/src/main/java/io/zipcoder/StringsAndThings.java index 073467a..1a2fe04 100644 --- a/src/main/java/io/zipcoder/StringsAndThings.java +++ b/src/main/java/io/zipcoder/StringsAndThings.java @@ -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; } /** @@ -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; } diff --git a/target/classes/io/zipcoder/StringsAndThings.class b/target/classes/io/zipcoder/StringsAndThings.class new file mode 100644 index 0000000000000000000000000000000000000000..bc32e2cd80bedb1427c3e6fdeae14af68f304209 GIT binary patch literal 1405 zcma)5O;giQ6g{s=lTv~}vDM0lfC?=LMZ}7rjL6_nr<8HZFaxgAG_=8x#59G`HUC4$ zja%KI+3fFb6AKXg7FAaQS>9tmkGX1MsXWc zGNxr@7^H`WWq3;rLMpw*AgkXsmRgD_M zP~NaJZwyDHST|GjT*Io=maXz;l?#guvS!yUZ+nMfJeA*557dmQT9t<9V!FkYvpl_` zyA;DL`f~Ig^2^TzF@z1vse24vrtW#VyTY%~U9unAZkbs1y=WKJRrFNt<+|$lDae?S zkz`O@ecwLN1L_R(ZCIWKYvmn85^b@h)~H-k0LU57&DY%EMjQa}a@ql6AUoB+lX*OV^w5Mytyv1}{w{Xodjq{Rf+YZUpt%_Im$B&vV zX;sx-CIm5+ORq5WHm_|=1`X4JYS#6QU4{fXwY24Qb}#~&CZ9hN7|)#6PSP^8Gup!w zpTRzn5Q5Th0)=#utOO3Ygl^I(N%Yc6!Hg&p6i^f%O~yjU5DHTZVp9B;4GUQ*F2%#| zkxhzmX?8(Q%Eu71k)#}th~;C1d$!-Ax2f&CgK!jLM-uyR@_pb7q>ltE_*6!H-Z3K9 zN0(j3DB?&XfmK|=8tDZL`ZSj)vox+FMt%|U8l$r~r9ku=)VY)(8zZde6x~OA2cF?7 zl62QK@|=NiLSeGZ-+m@zfL=-yKlxA5&rS$gY#vesO*4jqa^NxT0@*^0vu`crgwJp| zIQ_#WL~J=5?mJ9Uh~yDs9&{#4d#Ej1)<;VOr!8nfZVWg617rCDjGL!T#`!$fFTl9v HXEyd5nDqts literal 0 HcmV?d00001 diff --git a/target/test-classes/io/zipcoder/stringsandthings/ContainsEqualNumberOfIsAndNotTest.class b/target/test-classes/io/zipcoder/stringsandthings/ContainsEqualNumberOfIsAndNotTest.class new file mode 100644 index 0000000000000000000000000000000000000000..556ec648ddd0173f22453fac00953e644e289eef GIT binary patch literal 1323 zcmb7DZBG+H5Pr5Tv|JA;MG+Jb3PLH$$&0TTA`nSPnvzJ!0H(EUm(>8~*) zi*q%G)FuTo^p~X)mEfc<+$yiz-UP zUTZ@fIIf_?exXsfy$EWNZp0ftxflk^$NU4gY_1Ni4aczsSCo)zLy5>QVJ!WJy3Ang zI)U2|TT&Ne=Ef^6XlfHV3^0sd*8&rL=x4}M!@LRl=)NW%V=;{-6U$gh95es` literal 0 HcmV?d00001 diff --git a/target/test-classes/io/zipcoder/stringsandthings/CountTripleTest.class b/target/test-classes/io/zipcoder/stringsandthings/CountTripleTest.class new file mode 100644 index 0000000000000000000000000000000000000000..29d3cfe89a19ec698f6f56f4b5783c566258b309 GIT binary patch literal 1321 zcmbW0YflqF6o%jFZA-gKDHr7`1(dcRtALt_F+rjUNtHxMgP+WFJCr45w{Ewj`man> zh$j93f0Xgv?Mll{6ZXUGnKN_V=bSS$zkYxJ31AgZQqVD@VK#*bX8MrETncw_FNt~I zlTV?5ViF5UENZx~VM!p<^jyoXHP`Lx&c1I5OqDFh_+&Lqr>b0I``r4PK;oHYTi$bl zXuePuh;4AAK!3@y)tlB~MY%h&Ql}?da!gq-OV{$}p)=;~TZAl~frLp&yUJB2VQe@p z+uL!i2IExIBQ)MrUaKK6`j#u!p(m9k?Re6&9Gjv9x;5jV#q5k1YR_>M12g7X zt%m|h)ov)$Q&oY%(t$jZMqS!9W7GCjO}T!B()3!g&fp%!Fp=|m%NG$V0;z4M<(lf1 z=PIpT z9+&AJ-FmaBTxOulzIgSL7=}vG6 ziBonA<4m%jB~8$Z;4gSG08d>6Cr-hASAxd~9;fI8L6g@4-?<2mo`O?Xf^!7V5Ijrp M+_k{dtUH3-AHtao{r~^~ literal 0 HcmV?d00001 diff --git a/target/test-classes/io/zipcoder/stringsandthings/CountYZTest.class b/target/test-classes/io/zipcoder/stringsandthings/CountYZTest.class new file mode 100644 index 0000000000000000000000000000000000000000..27178e441080925aa59e674cb2fb937740d251ba GIT binary patch literal 1372 zcmbtTYfsZ)7(MT9Eu+c+CxAzIo`;4x1^4qvVXhDTc%WiFj}ppZM$cmb ziz=2>EGsY+JQOH+zH8YHZ^N$d9fg6wRK;?PGpki|>e4lK|EaGFF${aO=gBFPR(pqP1g#~aWdl{StQXfk;EcQyUr>_7@JOD`}-gE zr00_`>q$Ro35>sI);f_@%d?2MVcU*x`j%r8kYsMdI1Z@Hcr6bdS8`CRB{(a@vFujh zhrP$fSPE!&q3>4s~YH9s($^sI|2R@hCndYN}kAiwJb zZcV(ZJxL)hf~q;3#6l(rvE@{{~YPB$Rrryp9c2z6EVTj zVw};KWh}xR|BLBxD#P69P_~l2K<=IX1(}6!P_`GBE}$mxBisZOlg21ijFD)Zr-_J4 z??A*C6t|?@ezNB#P5A_TU`2YX_ literal 0 HcmV?d00001 diff --git a/target/test-classes/io/zipcoder/stringsandthings/GIsHappyTest.class b/target/test-classes/io/zipcoder/stringsandthings/GIsHappyTest.class new file mode 100644 index 0000000000000000000000000000000000000000..97d69c05d93af48f51dd343f570612e004b2bfd8 GIT binary patch literal 1210 zcmb7@YflqV5Qg8=7FxCov_%n=i`=9w%F4wn#-x~_CJiRiG?8zo<+vQO>^6Hbt^dkI z!D!+S@JAWvY!`RIK*E>ZnK?7>Gc$Yk_n#lX0Bqu!hGEQSv7jM^`61|7%wb76_cSb{ ztf7Kx4lC+?KZgfdtY%>_6g=ORw&~UEgT|pU7-s6yF+R&q+c^-fv3KEoi(&AEw59)& zAziLC88WXZkzuqhZLu31w}ji^EsG+hy3^)Xle<#+Q842lN`kDMgG5bm`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