MCPcopy Create free account
hub / github.com/douchuan/algorithm / vec_alphabet

Function vec_alphabet

src/common/util.rs:12–18  ·  view source on GitHub ↗

n, item length n = 1, vec!["a", "b", ... "z"] n = 2, vec!["aa", "bb", ... "zz"]

(n: usize)

Source from the content-addressed store, hash-verified

10// n = 1, vec!["a", "b", ... "z"]
11// n = 2, vec!["aa", "bb", ... "zz"]
12pub fn vec_alphabet(n: usize) -> Vec<String> {
13 debug_assert!(n > 0);
14 "abcdefghijklmnopqrstuvwxyz"
15 .chars()
16 .map(|c| String::from(c).repeat(n))
17 .collect()
18}
19
20/// return d-th character of s, -1 if d = length of string
21#[inline(always)]

Callers 3

MSD_best_caseFunction · 0.85
t_vec_alphabetFunction · 0.85
insert_sort_dthFunction · 0.85

Calls

no outgoing calls

Tested by 2

t_vec_alphabetFunction · 0.68
insert_sort_dthFunction · 0.68