A **distinct string** is a string that is present only **once** in an array.

Given an array of strings `arr`

, and an integer `k`

, return *the *`k`

^{th}* distinct string present in *

`arr`

. If there are `k`

distinct strings, return `""`

.Note that the strings are considered in the **order in which they appear** in the array.

**Example 1:**

Input:arr = ["d","b","c","b","c","a"], k = 2Output:"a"Explanation:The only distinct strings in arr are "d" and "a". "d" appears 1^{st}, so it is the 1^{st}distinct string. "a" appears 2^{nd}, so it is the 2^{nd}distinct string. Since k == 2, "a" is returned.

**Example 2:**

Input:arr = ["aaa","aa","a"], k = 1Output:"aaa"Explanation:All strings in arr are distinct, so the 1^{st}string "aaa" is returned.

**Example 3:**

Input:arr = ["a","b","a"], k = 3Output:""Explanation:The only distinct string is "b". Since there are fewer than 3 distinct strings, we return an empty string "".

**Constraints:**

`1 <= k <= arr.length <= 1000`

`1 <= arr[i].length <= 5`

`arr[i]`

consists of lowercase English letters.

```
struct Solution;
use std::collections::HashMap;
impl Solution {
fn kth_distinct(arr: Vec<String>, k: i32) -> String {
let mut hm: HashMap<String, usize> = HashMap::new();
let n = arr.len();
for i in 0..n {
*hm.entry(arr[i].clone()).or_default() += 1;
}
let mut j = 0;
for i in 0..n {
if hm[&arr[i]] == 1 {
j += 1;
}
if j == k {
return arr[i].clone();
}
}
"".to_string()
}
}
#[test]
fn test() {
let arr = vec_string!["d", "b", "c", "b", "c", "a"];
let k = 2;
let res = "a".to_string();
assert_eq!(Solution::kth_distinct(arr, k), res);
let arr = vec_string!["aaa", "aa", "a"];
let k = 1;
let res = "aaa".to_string();
assert_eq!(Solution::kth_distinct(arr, k), res);
let arr = vec_string!["a", "b", "a"];
let k = 3;
let res = "".to_string();
assert_eq!(Solution::kth_distinct(arr, k), res);
}
```