{"id":16551919,"url":"https://github.com/coogie/algopractice","last_synced_at":"2026-06-07T19:33:05.956Z","repository":{"id":68522044,"uuid":"332275380","full_name":"coogie/AlgoPractice","owner":"coogie","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-25T12:11:19.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-15T00:29:11.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/coogie.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-23T18:03:57.000Z","updated_at":"2021-01-25T12:11:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"c4748430-c7a5-443c-94f2-32d47a001def","html_url":"https://github.com/coogie/AlgoPractice","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/coogie%2FAlgoPractice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coogie%2FAlgoPractice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coogie%2FAlgoPractice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coogie%2FAlgoPractice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coogie","download_url":"https://codeload.github.com/coogie/AlgoPractice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241885469,"owners_count":20036953,"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":[],"created_at":"2024-10-11T19:43:32.268Z","updated_at":"2025-03-04T16:43:38.100Z","avatar_url":"https://github.com/coogie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Common Algos\n\nExercises, solutions, and benchmarks to common algorithms and whiteboarding\nquestions.\n\n## Overview\n\n### Testing\n\nEach problem has its own folder dedicated to it, along with a test suite to\nverify expected outcomes. This test file uses a custom `describe` method which\nwill allow me to pass in an arbitrary number of methods from the index file\n(imported as `import * as ...`) and execute the same suite of tests across each\nexported method without having to duplicate tests.\n\n```\n$ npm test reversestring\n\n PASS  exercises/reversestring/test.mjs\n\nreversestring\n    Naive Reverse\n      √ reverses a string (2 ms)\n      √ reverses a string with whitespace\n    for loop\n      √ reverses a string\n      √ reverses a string with whitespace (1 ms)\n    for..of loop\n      √ reverses a string\n      √ reverses a string with whitespace\n    arr.reduce\n      √ reverses a string\n      √ reverses a string with whitespace\n\nTest Suites: 1 passed, 1 total\nTests:       8 passed, 8 total\nSnapshots:   0 total\nTime:        0.558 s, estimated 1 s\nRan all test suites matching /reversestring/i.\n\nActive Filters: filename /reversestring/\n```\n\n### Benchmarking\n\nEach exercise is also benchmarkable thanks to [BenchmarkJS][1]. Similar to the\ntest suite setup, benchmarking is also set up to run benchmarks on all exported\nmethods. The only restriction being that each exercise file _must_ have an\n`export const data` with the argument value to be passed to the methods being\nbenchmarked.\n\nOptionally, each method can have a descriptive `testname` property which will be\nused in the benchmarking output. If not present, the function name will be used\ninstead.\n\n```\n$ npm run bench reversestring\n\n  ┌ Running \"reversestring\" benchmarks...\n  ├─ Naive Reverse x 3,072,077 ops/sec ±0.31% (94 runs sampled)\n  ├─ for loop x 11,899,016 ops/sec ±0.77% (90 runs sampled)\n  ├─ for..of loop x 9,729,595 ops/sec ±1.82% (86 runs sampled)\n  ├─ arr.reduce x 6,032,047 ops/sec ±0.76% (91 runs sampled)\n  └ Done!\n\nFastest is \"for loop\"\n```\n\n[1]: https://benchmarkjs.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoogie%2Falgopractice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoogie%2Falgopractice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoogie%2Falgopractice/lists"}