You are viewing a single comment's thread. Return to all comments →
int minJump = 0; int currIndex = 0; int itr = 0; while (currIndex < c.size() & itr < c.size()) { while (currIndex < c.size()-2 && c.get(currIndex+2) == 0) { currIndex = currIndex + 2; minJump++; // System.out.println(currIndex); } while (currIndex < c.size()-1 && c.get(currIndex+1) == 0) { currIndex = currIndex + 1; minJump++; // System.out.println(currIndex); } itr++; } // System.out.println(minJump); return minJump;
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →