Thanks for pointing that out. I wasn't seeing it in my test because the last two numbers in my data set were the same.
Hunter
Type: Posts; User: mcmillhj
Thanks for pointing that out. I wasn't seeing it in my test because the last two numbers in my data set were the same.
Hunter
When I make the change you suggest my algorithm actually does not work.
with this input and your suggested change: {2,3,4,9,11,12,13,16,19,19}
I get this output:
rangeString: 2-9, 9,...
I wrote this one, I think mine is a little simpler than yours. Let me know what you think.
public class TestRange
{
public static void main(String[] args)
{
int[] intArray =...