Guest User

Untitled

a guest
May 28th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public class Solution {
  2. public static void main(String[] args) {
  3. Integer[] input2 = {4,5,2,25};
  4. Integer[] input1 = {1,2,3};
  5.  
  6. //Arrays.sort(input1, Collections.reverseOrder());
  7. //System.out.println(Arrays.equals(input1, input2));
  8. //System.out.println(Arrays.toString(input1));
  9.  
  10. for (int i = 0; i < input1.length; i++) {
  11. int j = i + 1;
  12. while (true) {
  13. if (j > input1.length - 1){
  14. System.out.println(input1[i] + "---> -1");
  15. break;
  16. }
  17.  
  18. if (input1[j] > input1[i]) {
  19. System.out.println(input1[i] + "--->" + input1[j]);
  20. break;
  21. }
  22. j++;
  23. }
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment