Skip to content

Commit f80a7e1

Browse files
add skeleton for 1200
1 parent ddbfd06 commit f80a7e1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.fishercoder.solutions;
2+
3+
import java.util.List;
4+
5+
/**
6+
* 1200. Minimum Absolute Difference
7+
*
8+
* Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.
9+
* Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows
10+
* a, b are from arr
11+
* a < b
12+
* b - a equals to the minimum absolute difference of any two elements in arr
13+
*
14+
* Example 1:
15+
* Input: arr = [4,2,1,3]
16+
* Output: [[1,2],[2,3],[3,4]]
17+
* Explanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order.
18+
*
19+
* Example 2:
20+
* Input: arr = [1,3,6,10,15]
21+
* Output: [[1,3]]
22+
*
23+
* Example 3:
24+
* Input: arr = [3,8,-10,23,19,-4,-14,27]
25+
* Output: [[-14,-10],[19,23],[23,27]]
26+
*
27+
* Constraints:
28+
* 2 <= arr.length <= 10^5
29+
* -10^6 <= arr[i] <= 10^6
30+
* */
31+
public class _1200 {
32+
public static class Solution1 {
33+
public List<List<Integer>> minimumAbsDifference(int[] arr) {
34+
return null;
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy