>>485
Rust

fn odai(文字列: &str, 長さ: usize) -> Vec<String> {
use itertools::Itertools;
(0..長さ)
.map(|_| 文字列.chars())
.multi_cartesian_product()
.map(String::from_iter)
.collect()
}

fn main() {
assert_eq!(odai("ABC", 1), ["A", "B", "C"]);
assert_eq!(odai("ABC", 2), ["AA", "AB", "AC", "BA", "BB", "BC", "CA", "CB", "CC"]);
assert_eq!(odai("ABC", 3), ["AAA", "AAB", "AAC", "ABA", "ABB", "ABC", "ACA", "ACB", "ACC", "BAA", "BAB", "BAC", "BBA", "BBB", "BBC", "BCA", "BCB", "BCC", "CAA", "CAB", "CAC", "CBA", "CBB", "CBC", "CCA", "CCB", "CCC"]);
}