Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Read in input, store it in 2 arrayLists, one with the x coordinates and one with the y coordinates
- // Point 1 is top point
- // First find the top most point
- Loop through all the points and find the index of the point with the maximum y coordinate
- int max = 0;
- for (int i=0; i<N; i++) {
- if (y.get(i) >y.get(max)) {
- max = i;
- }
- }
- // Find the area if we remove the top most point - loop through all the points except max and find maxx, minx, maxy, and miny
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement