- My blog: https://su8.github.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs; | |
| use std::fs::File; | |
| use std::fs::DirEntry; | |
| use std::io; | |
| use std::io::Write; | |
| use std::path::Path; | |
| use std::path::PathBuf; | |
| use std::sync::Mutex; | |
| use std::thread; | |
| use std::collections::HashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs::{self, DirEntry, Metadata}; | |
| use std::io::{self, BufRead, BufReader, Write}; | |
| use std::path::Path; | |
| use std::sync::{Arc, Mutex}; | |
| use std::thread; | |
| static mut CURRENT_DIR_NUM: std::collections::HashMap<String, usize> = std::collections::HashMap::new(); | |
| fn walk_multiple_dirs(folder: &str, opt: char) { | |
| let mut count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs::{self, DirEntry, Metadata}; | |
| use std::io::{self, BufRead, BufReader, Write}; | |
| use std::path::Path; | |
| use std::sync::{Arc, Mutex}; | |
| use std::thread; | |
| static mut CURRENT_DIR_NUM: std::collections::HashMap<String, usize> = std::collections::HashMap::new(); | |
| fn walk_multiple_dirs(folder: &str, opt: char) { | |
| let mut count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs; | |
| use std::fs::File; | |
| use std::io::prelude::*; | |
| use std::path::Path; | |
| use std::path::PathBuf; | |
| use std::sync::Mutex; | |
| use std::thread; | |
| use std::thread::JoinHandle; | |
| use std::collections::HashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs::{self, DirEntry, Metadata}; | |
| use std::io::{self, BufRead, BufReader, Write}; | |
| use std::path::Path; | |
| use std::sync::{Arc, Mutex}; | |
| use std::thread; | |
| static mut CURRENT_DIR_NUM: std::collections::HashMap<String, usize> = std::collections::HashMap::new(); | |
| fn walk_multiple_dirs(folder: &str, opt: char) { | |
| let mut count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::vector::{self, String}; | |
| use std::iter::FromIterator; | |
| use std::str::FromStr; | |
| fn variants(word: &str) -> Vec<String> { | |
| let mut result = Vec::new(); | |
| result.push(word.to_string()); | |
| let mut capitalized = word.to_string(); | |
| if !capitalized.is_empty() { | |
| capitalized.replace_range(..1, &capitalized[..1].to_uppercase()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::env; | |
| fn variants(word: &str) -> Vec<String> { | |
| let mut result = Vec::new(); | |
| result.push(word.to_string()); | |
| let mut capitalized = word.to_string(); | |
| if let Some(first_char) = capitalized.get_mut(0..1) { | |
| capitalized.replace_range(0..1, &first_char.to_uppercase()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::env; | |
| use std::process; | |
| fn variants(word: &str) -> Vec<String> { | |
| let mut result = Vec::new(); | |
| result.push(word.to_string()); | |
| if !word.is_empty() { | |
| let mut capitalized = word.to_string(); | |
| if let Some(first_char) = capitalized.get_mut(0..1) { first_char.make_ascii_uppercase(); } | |
| result.push(capitalized); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::HashSet; | |
| use std::fs::File; | |
| use std::io::{self, BufRead, BufReader}; | |
| use std::path::Path; | |
| fn variants(word: &str) -> Vec<String> { | |
| let mut result = vec![word.to_string()]; | |
| let capitalized = word.to_ascii_uppercase(); | |
| result.push(capitalized); | |
| let upper = word.to_uppercase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdio> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <cctype> | |
| #include <string> | |
| #include <regex> | |
| #include <random> | |
| #include <algorithm> |