1
0
This commit is contained in:
2026-02-04 11:15:03 +08:00
commit 8b20a5dd21
125 changed files with 4177 additions and 0 deletions

6
problems/p52/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "p52"
version = "0.1.0"
edition = "2024"
[dependencies]

32
problems/p52/src/main.rs Normal file
View File

@@ -0,0 +1,32 @@
use std::collections::HashSet;
fn is_same_digits(x: u32) -> bool {
let x_2 = x * 2;
let x_3 = x * 3;
let x_4 = x * 4;
let x_5 = x * 5;
let x_6 = x * 6;
let set_x: HashSet<char> = x.to_string().chars().collect();
let set_x_2: HashSet<char> = x_2.to_string().chars().collect();
let set_x_3: HashSet<char> = x_3.to_string().chars().collect();
let set_x_4: HashSet<char> = x_4.to_string().chars().collect();
let set_x_5: HashSet<char> = x_5.to_string().chars().collect();
let set_x_6: HashSet<char> = x_6.to_string().chars().collect();
set_x == set_x_2
&& set_x_2 == set_x_3
&& set_x_3 == set_x_4
&& set_x_4 == set_x_5
&& set_x_5 == set_x_6
}
fn main() {
let mut x = 1;
loop {
if is_same_digits(x) {
println!("{x}");
break;
}
x += 1;
}
}