{"id":24058245,"url":"https://github.com/ctsrc/dp","last_synced_at":"2026-06-11T03:31:24.955Z","repository":{"id":84662200,"uuid":"388259559","full_name":"ctsrc/dp","owner":"ctsrc","description":"Dynamic Programming problems and solutions","archived":false,"fork":false,"pushed_at":"2023-10-25T02:11:34.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T13:12:53.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/ctsrc.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-07-21T22:18:45.000Z","updated_at":"2024-02-05T23:09:39.000Z","dependencies_parsed_at":"2023-10-25T03:26:49.712Z","dependency_job_id":null,"html_url":"https://github.com/ctsrc/dp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ctsrc/dp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctsrc%2Fdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctsrc%2Fdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctsrc%2Fdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctsrc%2Fdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctsrc","download_url":"https://codeload.github.com/ctsrc/dp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctsrc%2Fdp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34181554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":"2025-01-09T05:56:34.387Z","updated_at":"2026-06-11T03:31:24.939Z","avatar_url":"https://github.com/ctsrc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic programming problems and solutions\n\nDynamic programming \\[...\\] refers to simplifying a complicated problem\nby breaking it down into simpler sub-problems in a recursive manner.\n\nhttps://en.wikipedia.org/wiki/Dynamic_programming\n\n## Table of Contents\n\n* [Highlighted problems and solutions](#highlighted-problems-and-solutions)\n* [Mo' money 🤑 🤑 🤑 mo' problems 😩 😩 😩](#mo-money----mo-problems---)\n\n## Highlighted problems and solutions\n\n### [Stockmax](stockmax)\n\nYour algorithms have become so good at predicting the market that you now know\nwhat the share price of Wooden Orange Toothpicks Inc. (WOT) will be\nfor the next number of days.\n\nEach day, you can either buy one share of WOT, sell any number of shares of WOT\nthat you own, or not make any transaction at all. What is the maximum profit\nyou can obtain with an optimum trading strategy?\n\n[READ MORE](stockmax)\n\n```bash\ncargo test --release --doc -p stockmax\n```\n\n```text\nrunning 3 tests\ntest src/lib.rs - stockmax (line 7) ... ok\ntest src/lib.rs - stockmax (line 3) ... ok\ntest src/lib.rs - stockmax (line 11) ... ok\n\ntest result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\n```\n\n```bash\ncargo run --release stockmax \u003c stockmax/test/input/input11.txt\n```\n\n```text\n6\n4\n```\n\n## Mo' money 🤑 🤑 🤑 mo' problems 😩 😩 😩\n\nThis section lists problems and solutions that were not\ninteresting enough to deserve highlighting.\n\nCurrently there are no problems and solutions in this section.\nMainly because only one problem has been solved so far.\nAnd partly because not interesting problems are also not so\ninteresting to solve so I might decide not to solve them\nin the first place.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctsrc%2Fdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctsrc%2Fdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctsrc%2Fdp/lists"}