{"id":21166003,"url":"https://github.com/peterdee/pairs-test-angular","last_synced_at":"2025-10-24T05:45:14.957Z","repository":{"id":103803829,"uuid":"196998652","full_name":"peterdee/pairs-test-angular","owner":"peterdee","description":"Pairs Test (Angular)","archived":false,"fork":false,"pushed_at":"2020-04-16T20:23:31.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"deploy","last_synced_at":"2025-03-14T16:49:12.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pairs-test.herokuapp.com/","language":"TypeScript","has_issues":false,"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/peterdee.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":"2019-07-15T12:54:59.000Z","updated_at":"2020-04-16T20:23:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"a748b001-8cc8-4b84-b3a8-45d5ad48ad77","html_url":"https://github.com/peterdee/pairs-test-angular","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterdee/pairs-test-angular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fpairs-test-angular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fpairs-test-angular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fpairs-test-angular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fpairs-test-angular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterdee","download_url":"https://codeload.github.com/peterdee/pairs-test-angular/tar.gz/refs/heads/deploy","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdee%2Fpairs-test-angular/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261827684,"owners_count":23215792,"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-11-20T14:47:52.360Z","updated_at":"2025-10-24T05:45:09.925Z","avatar_url":"https://github.com/peterdee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pairs Test (Angular)\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.1.1.\n\nNode version for this project can be found in the [packege.json](package.json) file.\n\n### Task\n\n```text\nYou are given a list of integers, both positive and negative.\nEach integer in the list must either be paired with another element in the\nlist or be a single element.\nOnce the elements have been paired, the integers in the pairs are multiplied\nand the results are summed up - the sum will include the single elements.\nWrite a program to find the sequence of pairs and singles which\ngive the biggest possible sum, and calculate this max sum.\n\nExamples:\n1. For the list [0,1,2,3,4,5] the pairs (4,5) and (2,3) are formed\nand 0 and 1 are single elements. The max. sum is 27: (20+6+0+1).\n2. For the list [-1,0,1] the pairs (-1,0) is formed and 1 is a single element.\nThe max. sum is 1.\n3. For the list [1,1] no pairs are formed only two single elements. The max. sum is 2. \n\nYou choose how input/output is handled etc.\n```\n\n### Deploy\n\n- `git clone https://github.com/peterdee/pairs-test-angular`\n- `cd pairs-test-angular`\n- `nvm use 11.14` (you can find the correct Node version in the [package.json](package.json) file)\n- `npm i`\n\n### Launch\n\n`npm run dev`\n\nSince the app uses `80` port, you can receive this error:\n\n```text\nAn unhandled exception occurred: listen EACCES: permission denied 127.0.0.1:80\n```\n\nYou can still launch the app with `sudo`:\n\n`sudo npm run dev`\n\nDevelopment server will be available at http://localhost:80\n\n### Build\n\n`npm run build`\n\nUse `sudo` if you are getting the `EACCESS` errors.\n\nThe build artifacts will be stored in the `dist/` directory.\n\nUse the `--prod` flag for a production build.\n\n### Static serving\n\n`npm start`\n\nStatic files are served from the `/dist` directory with `Express`.\n\nTo serve the static, run the `build` command first.\n\n### Heroku deployment\n\nThe app deployed to Heroku automatically (`deploy` branch).\n\nAvailable at https://pairs-test.herokuapp.com\n\n### Testing\n\n`npm run test`\n\nUse `sudo` if you are getting the `EACCESS` errors.\n \nTests are executed via [Karma](https://karma-runner.github.io).\n\n### How to use\n\n- Enter the values in the `Values` input field. \n\nValues should be separated with the comma symbol (`,`).\n\nValues should be integers or symbols.\n\nThe app will check all of the values, and only the numbers will be used for the pair multiplication.\n\n- Press the `CALCULATE` button or hit `ENTER` after you entered all of the values.\n\n- Resulting value will be displayed under the `CALCULATE` button.\n\n### Brief algorithm walk through\n\n- Entered values are split into an array.\n\n- All of the values in the array are checked, and only the numbers are left in the resulting array.\n\n- Resulting array of numbers is split into two separate arrays of integers: one for the positive values, and one for the negative values (negative array includes zeroes).\n\n- Both positive and negative arrays are then processed, pairs are getting determined recursively. Two new arrays are formed: one with the multiplications of the positive values, and another one with the multiplications of the negative values.\n\n- Total sum is calculated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdee%2Fpairs-test-angular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterdee%2Fpairs-test-angular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdee%2Fpairs-test-angular/lists"}