Dear EE members,
I would like to establish:
http://codingbat.com/prob/p121596
Here is my code:
public String altPairs(String str) { //01 23 45 67 89 i=0,1 i=i+4,i+5
String newStr = "";
int counter = 0;
while(counter<newStr.lengt
h()){
if(counter==0||counter==1)
newStr += str.charAt(0);
counter=counter+4;
newStr += str.charAt(counter);
}
return newStr;
}
Regards,
yjchong514