Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch.claude_martin;
- import java.util.Arrays;
- import java.util.OptionalInt;
- public class SomeClass {
- public static void main(String[] args) {
- final int[] v1 = { 3, 5 };
- final int[] v2 = { 3, 6 };
- final int[] v3 = {};
- final int[] v4 = { -1, Integer.MIN_VALUE };
- long max = Long.MIN_VALUE;
- int[] maxVec = null;
- for (???????????) {
- final OptionalInt m = Arrays.stream(v).max();
- if (???????????) {
- max = m.getAsInt();
- maxVec = v;
- }
- }
- if (?????)
- System.out.println(max + " -> " + Arrays.toString(maxVec));
- else
- System.out.println("No data");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement