Skip to content

Commit c61cde6

Browse files
committed
Added Missing Description for Find K Closest Elements
1 parent a90cec4 commit c61cde6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/find_k_closest_elements.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ impl State {
1616

1717
}
1818

19+
/// Given a sorted integer array `arr`, two integers `k` and `x`, return the
20+
/// `k` closest integers to `x` in the array. The result should also be sorted
21+
/// in ascending order.
22+
///
23+
/// An integer `a` is closer to `x` than an integer `b` if:
24+
/// * `|a - x| < |b - x|`, or
25+
/// * `|a - x| == |b - x|` and `a < b`
1926
struct Solution;
2027

2128
impl Solution {

0 commit comments

Comments
 (0)