Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static void main(String[] args) {
- Integer[] input2 = {4,5,2,25};
- Integer[] input1 = {1,2,3};
- //Arrays.sort(input1, Collections.reverseOrder());
- //System.out.println(Arrays.equals(input1, input2));
- //System.out.println(Arrays.toString(input1));
- for (int i = 0; i < input1.length; i++) {
- int j = i + 1;
- while (true) {
- if (j > input1.length - 1){
- System.out.println(input1[i] + "---> -1");
- break;
- }
- if (input1[j] > input1[i]) {
- System.out.println(input1[i] + "--->" + input1[j]);
- break;
- }
- j++;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment