waltermilner

Untitled

Apr 10th, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.List;
  3.  
  4. public class Test {
  5.  
  6.   public static void main(String[] args) {
  7.     Integer[] a = {8, 7, 6, 4, 3, 2, 1, 0};
  8.     List<Integer> list = Arrays.asList(a);
  9.     int n = list.size() - 1;
  10.     for (int i = 0; i < n; i++) {
  11.       if (!list.contains(i)) {
  12.         System.out.println(i); // 5
  13.         break;
  14.       }
  15.     }
  16.  
  17.   }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment