{"id":30863210,"url":"https://github.com/runattekky/polynomial-problem","last_synced_at":"2025-09-07T18:07:50.580Z","repository":{"id":312534198,"uuid":"1047812046","full_name":"RunAtTekky/polynomial-problem","owner":"RunAtTekky","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-31T09:55:04.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T11:35:34.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blog.runat.xyz/post/polynomial-problem/","language":"Go","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/RunAtTekky.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-31T09:38:17.000Z","updated_at":"2025-08-31T10:14:01.000Z","dependencies_parsed_at":"2025-08-31T11:35:37.704Z","dependency_job_id":"9e65b6ac-b1ee-4117-877c-2504499a9294","html_url":"https://github.com/RunAtTekky/polynomial-problem","commit_stats":null,"previous_names":["runattekky/polynomial-problem"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/RunAtTekky/polynomial-problem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RunAtTekky%2Fpolynomial-problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RunAtTekky%2Fpolynomial-problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RunAtTekky%2Fpolynomial-problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RunAtTekky%2Fpolynomial-problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RunAtTekky","download_url":"https://codeload.github.com/RunAtTekky/polynomial-problem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RunAtTekky%2Fpolynomial-problem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274073757,"owners_count":25217776,"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-09-07T02:00:09.463Z","response_time":67,"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-09-07T18:07:45.448Z","updated_at":"2025-09-07T18:07:50.566Z","avatar_url":"https://github.com/RunAtTekky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polynomial Problem\n[Notion Link for input format](https://honorable-marimba-e75.notion.site/Hashira-Placements-Assignment-Online-16c880a946cf805f9ab6c3aacd180f8d)\n\nI didn't attend the process where this problem was asked but I found the problem statement very interesting.\n\nSo here is my attempt to solve it with [Test Driven Development (TDD)](https://en.wikipedia.org/wiki/Test-driven_development) as I am also learning [Go with tests](https://github.com/RunAtTekky/Learn-GO-with-tests)\n\n\u003e Basically you are given system of linear equations. Solve it.\n\n\u003e I am solving this problem with [Gaussian Elimination Method](https://www.geeksforgeeks.org/dsa/gaussian-elimination/) which uses [Row Echelon Form](https://en.wikipedia.org/wiki/Row_echelon_form) and Back Substitution\n\n### Input\n```json\n{\n    \"keys\": {\n        \"n\": 4,\n        \"k\": 3\n    },\n    \"1\": {\n        \"base\": \"10\",\n        \"value\": \"4\"\n    },\n    \"2\": {\n        \"base\": \"2\",\n        \"value\": \"111\"\n    },\n    \"3\": {\n        \"base\": \"10\",\n        \"value\": \"12\"\n    },\n    \"6\": {\n        \"base\": \"4\",\n        \"value\": \"213\"\n    }\n}\n```\n\n### JSON Parser\nInput: input.json\n\nOutput: Unmarshal data into keys `Keys` and entries `map[string]Entry`\n\nAlso we get n, the number of entries given\n\nWe get k, which is equations required to solve polynomial.\n\nWe get m, which is degree of polynomial.\n\n### Conversion\nConvert bases (say from base 2 to base 6)\n\nInput: base, value\n\nOutput: Value in decimal\n\n### Create equation\nInput: x, y, m\n\nOutput: Linear equation {expression, y}\n\n### Create Augmented Matrix\nInput: Linear equations and their values y\n\nOutput: Matrix with linear equations and y\n\n\n### Gaussian Elimination Method\n#### Row Echelon Form\nInput: Augmented matrix\n\nOutput: Convert to row echelon form\n\n#### Back substitution\nInput: Row echelon form\n\nOutput: Give the value of variables in a map {a: X, b: X, c: X, ....}\n\n\n\u003e We got our answer\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunattekky%2Fpolynomial-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunattekky%2Fpolynomial-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunattekky%2Fpolynomial-problem/lists"}