troubleshooting Question

starOut java challenge

Avatar of gudii9
gudii9Flag for United States of America asked on
JavaJava EEProgramming Languages-OtherProgrammingJava App Servers
95 Comments2 Solutions805 ViewsLast Modified:
Hi,
I am working on below challenge
http://codingbat.com/prob/p139564
I tried my code as below
public String starOut(String str) {
return str.replaceAll("./*.","");
  
}
I am getting below result
Expected      Run            
starOut("ab*cd") → "ad"      "d"      X         
starOut("ab**cd") → "ad"      ""      X         
starOut("sm*eilly") → "silly"      ""      X         
starOut("sm*eil*ly") → "siy"      "y"      X         
starOut("sm**eil*ly") → "siy"      ""      X         
starOut("sm***eil*ly") → "siy"      "y"      X         
starOut("stringy*") → "string"      ""      X         
starOut("*stringy") → "tringy"      ""      X         
starOut("*str*in*gy") → "ty"      ""      X         
starOut("abc") → "abc"      "c"      X         
starOut("a*bc") → "c"      ""      X         
starOut("ab") → "ab"      ""      X         
starOut("a*b") → ""      "b"      X         
starOut("a") → "a"      "a"      OK         
starOut("a*") → ""      ""      OK         
starOut("*a") → ""      ""      OK         
starOut("*") → ""      "*"      X         
starOut("") → ""      ""      OK         
other tests
X         

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
zzynx
Sr. Software engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 95 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 95 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros