Thanks for the help, I got it working and posted the working code above.
Type: Posts; User: adamniazi
Thanks for the help, I got it working and posted the working code above.
test class:
public class Test{
public static void main(String[] args){
String a1 = "";
String b1 = DNA.compress(a1);
System.out.println(b1);
String a3 = "Cat";
these are the tests i'm running, from a different class
String a1 = "";
String b1 = DNA.compress(a1);
System.out.println(b1);
String a3 = "Cat";
String b3 =...
So I've got pretty much everything working, except when I start getting double digits. The new code is at the bottom and the part that handles the double digits is bolded. I've code it working well...
I've modified to code to not give ArrayIndexOutOfBoundsException anymore. But it is still not giving me the correct output. Some letters seem to disappear or get added to ones that dont match.
new...
I am suppose to create a recursive method that will compress a DNA sequence. For example;
DNA.compress("GGCcCTtttTT") => "G2C3T6"
but my code keeps giving me an...