3 lines
154 B
Text
3 lines
154 B
Text
let arr = ["a", "bc", "def", "ghij"];
|
|
arr.binary_search(&"a"); // Search lexicographically
|
|
arr.binary_search_by(|e| e.len().cmp(&1)); // Search by length
|