normalize

Function normalize 

Source
pub fn normalize(s: &str) -> String
Expand description

Convert word to uppercase, and substitute all characters to be in alphabetical order. This makes words equivalent if they have the same charactaristics

use sub_solver::normalize;

assert_eq!(normalize("example"), "ABCDEFA");  // "example" has 2 'a's at the start and end
assert_eq!(normalize("example"), normalize("squares"));  // "example" and "squares" have the same repeated character positions
assert_eq!(normalize("testing"), "ABCADEF");  // "testing" does not have repeated characters at the start and end