{"id":18017009,"url":"https://github.com/fabmax/five-word-sets","last_synced_at":"2025-08-26T14:17:53.320Z","repository":{"id":54095241,"uuid":"522013642","full_name":"fabmax/five-word-sets","owner":"fabmax","description":"Find sets of five five letter words, sharing no letters","archived":false,"fork":false,"pushed_at":"2022-08-09T11:25:51.000Z","size":1127,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-27T06:17:37.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabmax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-06T17:39:14.000Z","updated_at":"2022-08-06T19:12:32.000Z","dependencies_parsed_at":"2022-08-13T06:40:47.070Z","dependency_job_id":null,"html_url":"https://github.com/fabmax/five-word-sets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fabmax/five-word-sets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Ffive-word-sets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Ffive-word-sets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Ffive-word-sets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Ffive-word-sets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabmax","download_url":"https://codeload.github.com/fabmax/five-word-sets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Ffive-word-sets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272228352,"owners_count":24895789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T04:19:54.856Z","updated_at":"2025-08-26T14:17:53.225Z","avatar_url":"https://github.com/fabmax.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# five-word-sets\n\nThis project is inspired by the YouTube video\n[Can you find: five five-letter words with twenty-five unique letters?](https://www.youtube.com/watch?v=_-AfhLQfb6w)\nby Matt Parker / Stand-up Maths. It solves the problem of finding sets of five five-letter words with 25 distinct\ncharacters (i.e. none of the words share any letters), which is supposed to be hard.\n\nThe initial list of words is provided by the text file [words_alpha.txt](words_alpha.txt), which is the same Parker\nused (the original link is here: [https://github.com/dwyl/english-words](https://github.com/dwyl/english-words)). It\ncontains 10175 five-letter words with no duplicate characters, which can be further reduced to 5977 words by removing\nanagrams.\n\nMy [solution](src/main/kotlin/FiveLetterWords.kt) solves the problem in **~25 seconds** (based on the 5977\nnon-anagram word set, on an 8-core CPU). It does not use fancy math but a few rather simple tricks:\n\n - Valid five-word sets must use 25 out of 26 characters. Therefore, we can select words containing two rare letters\n   (`x` and / or `q`, there are only 315 such words) and use only them as 'seed words'. Then we only have to find four\n   more words per seed word. Because every valid set must contain an `x` and / or a `q` we can't miss a set.\n  \n - Initially, we build 26 sets (one for each letter) containing all words that include the particular letter. This\n   helps in efficiently removing invalid word candidates later on.\n\n - The search function works recursively and removes invalid words from the list of candidates for deeper recursion\n   levels (using the words-by-letter sets built before). This way the search can terminate early once there are no more\n   word candidates left.\n\n - It does not use Python :wink:\n\n## Running the code\nYou can run the code from the console (You will need to have a Java JDK installed): \n```\n./gradlew run\n```\nAfter running the code, the resulting five-word sets can be found in `result.txt`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabmax%2Ffive-word-sets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabmax%2Ffive-word-sets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabmax%2Ffive-word-sets/lists"}