{"id":16544501,"url":"https://github.com/msoedov/trie","last_synced_at":"2025-12-02T03:05:13.195Z","repository":{"id":42398064,"uuid":"61993624","full_name":"msoedov/trie","owner":"msoedov","description":null,"archived":false,"fork":false,"pushed_at":"2016-06-26T14:52:28.000Z","size":4116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:17:25.063Z","etag":null,"topics":["trie-tree","word-path"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msoedov.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-26T14:49:16.000Z","updated_at":"2018-12-31T10:51:32.000Z","dependencies_parsed_at":"2022-09-09T18:33:39.308Z","dependency_job_id":null,"html_url":"https://github.com/msoedov/trie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Ftrie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Ftrie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Ftrie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msoedov%2Ftrie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msoedov","download_url":"https://codeload.github.com/msoedov/trie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801255,"owners_count":20022390,"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","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":["trie-tree","word-path"],"created_at":"2024-10-11T19:03:00.606Z","updated_at":"2025-12-02T03:05:08.163Z","avatar_url":"https://github.com/msoedov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Problem - Word Paths\n\nOutline\n\nThe problem is to find “word paths”. What this means is that you find a path from one word to\n\nanother word, changing one letter each step, and each intermediate word must be in the\n\ndictionary.\n\nWe tend to use the dictionary file on a unix/linux/mac in /usr/share/dict/words. If you do not\n\nhave a copy of this file, please let us know.\n\nSome example solutions:\n\n  ­\u003e real ­\u003e feal ­\u003e foal ­\u003e foul ­\u003e foud\n\ndung ­\u003e dunt ­\u003e dent ­\u003e gent ­\u003e geet ­\u003e geez\n\njehu ­\u003e jesu ­\u003e jest ­\u003e gest ­\u003e gent ­\u003e gena ­\u003e guna ­\u003e guha\n\nyagi ­\u003e yali ­\u003e pali ­\u003e palp ­\u003e paup ­\u003e plup ­\u003e blup\n\nbitt ­\u003e butt ­\u003e burt ­\u003e bert ­\u003e berm ­\u003e berm ­\u003e germ ­\u003e geum ­\u003e meum\n\njina ­\u003e pina ­\u003e pint ­\u003e pent ­\u003e peat ­\u003e prat ­\u003e pray\n\nfike ­\u003e fire ­\u003e fare ­\u003e care ­\u003e carp ­\u003e camp\n\nThe program should take as input the path to the word file, a start word and an end word and\n\nprint out at least one path from start to end, or something indicating there is no possible path if\n\nappropiate.\n\ne.g.\n\n$ python ./wordpaths.py /usr/share/dict/words flux alem\n\ncat ­\u003e cog ­\u003e cog ­\u003e dog\n\nRequirements\n\n● Please send your output as one .tar.gz file to your recruitment contact\n\n● Your software should have an appropiate basic command line utility to run\n\n● Try to demonstrate OO methodologies where possible (e.g. encapsulation)\n\n● Where your program is written in an interpreted language like ruby or python, please\n\nsay which version you’ve used\n\n● Include appropriate testing routines.\n\n● No use of third party libraries for the main code. The intent of the problem is to\n\ndemonstrate the ability to write the particular data structures \u0026 algorithms that are\n\nmost applicable to solve this problem.\n\n### Run\n\nThe solution works both with python2/python3 and pypy2/pypy3. It runs significantly faster with py3 comparing to py2.\n\n``` shell\npython3 main.py fike camp\n['fike', 'fake', 'fame', 'came', 'camp']\n```\nOr build the docker image and run inside of container\n\n```shell\n➜  trie git:(master) ✗ docker build -t word-paths .\nSending build context to Docker daemon 6.284 MB\nStep 1 : FROM python:3.5\n---\u003e e7814e9068f6\nStep 2 : COPY . /app\n---\u003e Using cache\n---\u003e 5f327408fd96\nStep 3 : WORKDIR /app\n---\u003e Using cache\n---\u003e 83e7825c700c\nSuccessfully built 83e7825c700c\n➜  trie git:(master) ✗ docker run -it word-paths python3 main.py fike camp -d\nLoaded in 0.29026317596435547\nHere we go: ['fike', 'fake', 'cake', 'came', 'camp']\n['fike', 'fake', 'cake', 'came', 'camp']\n\n```\n\n### Command line options\n\n`-d` is debug cli flag\n`-r` rebuild the cache file, this can take 1-2 hours on descent laptop\n\n### Notes\nIt won't work with `pypy` as is due incompatibility of pickle protocol between `cPython` and `PyPy` so in case you wanna run it with pypy you need to rebuild cached file.\n\n### Author\n\nAlex Myasoedov msoedov@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsoedov%2Ftrie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsoedov%2Ftrie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsoedov%2Ftrie/lists"}