Skip to content

Commit 38f160d

Browse files
refactor 658
1 parent c86ae82 commit 38f160d

File tree

1 file changed

+0
-21
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-21
lines changed

src/main/java/com/fishercoder/solutions/_658.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,6 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6-
/**
7-
* 658. Find K Closest Elements
8-
*
9-
* Given a sorted array, two integers k and x,
10-
* find the k closest elements to x in the array.
11-
* The result should also be sorted in ascending order.
12-
* If there is a tie, the smaller elements are always preferred.
13-
14-
Example 1:
15-
Input: [1,2,3,4,5], k=4, x=3
16-
Output: [1,2,3,4]
17-
18-
Example 2:
19-
Input: [1,2,3,4,5], k=4, x=-1
20-
Output: [1,2,3,4]
21-
22-
Note:
23-
The value k is positive and will always be smaller than the length of the sorted array.
24-
Length of the given array is positive and will not exceed 104
25-
Absolute value of elements in the array and x will not exceed 104
26-
*/
276
public class _658 {
287
public static class Solution1 {
298
public List<Integer> findClosestElements(List<Integer> arr, int k, int x) {

0 commit comments

Comments
 (0)