gudii9
asked on
zip zap java cchallenge
Hi,
I am working on below challenge
http://codingbat.com/prob/p180759
I tried my code as below
how to improve my approach, results and design of this challenge. How do i make a graphical venn or flow chart or some other relevant diagram to design it before writing code to decide best strategy?
Please advise
I am working on below challenge
http://codingbat.com/prob/p180759
I tried my code as below
public String zipZap(String str) {
String str2= str.replaceAll("z.p","zp");
return str2;
}
I am getting below resultExpected Run
zipZap("zipXzap") → "zpXzp" "zpXzp" OK
zipZap("zopzop") → "zpzp" "zpzp" OK
zipZap("zzzopzop") → "zzzpzp" "zzzpzp" OK
zipZap("zibzap") → "zibzp" "zibzp" OK
zipZap("zip") → "zp" "zp" OK
zipZap("zi") → "zi" "zi" OK
zipZap("z") → "z" "z" OK
zipZap("") → "" "" OK
zipZap("zzp") → "zp" "zp" OK
zipZap("abcppp") → "abcppp" "abcppp" OK
zipZap("azbcppp") → "azbcppp" "azbcppp" OK
zipZap("azbcpzpp") → "azbcpzp" "azbcpzp" OK
other tests
OK
how to improve my approach, results and design of this challenge. How do i make a graphical venn or flow chart or some other relevant diagram to design it before writing code to decide best strategy?
Please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Really?
Eliminating an obsolete variable was the answer you were looking for?
Ridiculous.
Eliminating an obsolete variable was the answer you were looking for?
Ridiculous.