Word wheel: Difference between revisions
Content added Content deleted
m (Tidied up C code a bit) |
m (Tidied up C++ code a bit) |
||
Line 124:
explicit letterset(const std::string& str) {
count_.fill(0);
for (char c : str)
}
bool contains(const letterset& set) const {
Line 139 ⟶ 135:
}
unsigned int count(char c) const {
}
bool is_valid() const {
Line 147 ⟶ 141:
}
private:
static bool is_letter(char c) { return c >= 'a' && c <= 'z'; }
static int index(char c) { return is_letter(c) ? c - 'a' + 1 : 0; }
// elements 1..26 contain the number of times each lowercase
// letter occurs in the word
|