Skip to content

A Rust implementation that finds anagrams of a given target word from a list of candidates. The solution considers case-insensitive matching, handles Unicode characters, and avoids treating a word as its own anagram. The project includes extensive tests to ensure correct functionality.

License

Notifications You must be signed in to change notification settings

haritonov2/rust_anagram_typer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cdb425b · Sep 18, 2024

History

2 Commits
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024
Sep 18, 2024

Repository files navigation

Rust Anagram Typer

This project is a Rust implementation for finding anagrams of a given target word from a list of candidates. It handles case-insensitive matching, works with Unicode characters, and ensures that a word is not considered an anagram of itself.

Usage

To find anagrams, call the anagrams_for function, providing a target word and a list of candidate words.

Example:

use rust_anagram_typer::anagrams_for;
use std::collections::HashSet;

let word = "listen";
let candidates = &["enlists", "google", "inlets", "banana"];
let anagrams = anagrams_for(word, candidates);

let expected: HashSet<&str> = HashSet::from_iter(["inlets"]);
assert_eq!(anagrams, expected);

About

A Rust implementation that finds anagrams of a given target word from a list of candidates. The solution considers case-insensitive matching, handles Unicode characters, and avoids treating a word as its own anagram. The project includes extensive tests to ensure correct functionality.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages