{"id":21001814,"url":"https://github.com/timoanttila/findminmaxsums","last_synced_at":"2025-03-13T14:11:21.615Z","repository":{"id":218319799,"uuid":"745851156","full_name":"timoanttila/findMinMaxSums","owner":"timoanttila","description":"Find the maximum and minimum possible sums","archived":false,"fork":false,"pushed_at":"2024-01-20T11:38:43.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T09:47:17.655Z","etag":null,"topics":["javascript","javascript-example","javascript-examples","javascript-examples-beginners","javascript-test","javascript-testing","javascript-tests"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/timoanttila.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}},"created_at":"2024-01-20T10:40:04.000Z","updated_at":"2024-01-21T05:18:14.000Z","dependencies_parsed_at":"2024-01-21T07:27:17.784Z","dependency_job_id":null,"html_url":"https://github.com/timoanttila/findMinMaxSums","commit_stats":null,"previous_names":["timoanttila/findminmaxsums"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoanttila%2FfindMinMaxSums","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoanttila%2FfindMinMaxSums/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoanttila%2FfindMinMaxSums/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoanttila%2FfindMinMaxSums/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timoanttila","download_url":"https://codeload.github.com/timoanttila/findMinMaxSums/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243419073,"owners_count":20287805,"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":["javascript","javascript-example","javascript-examples","javascript-examples-beginners","javascript-test","javascript-testing","javascript-tests"],"created_at":"2024-11-19T08:16:36.875Z","updated_at":"2025-03-13T14:11:21.598Z","avatar_url":"https://github.com/timoanttila.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Find the maximum and minimum possible sums\n\nYou are given three arguments:\n- `arr` = an `array` of numbers\n- `n` = the size of the `array`\n- `k` = number of reduced elements\n\nThe arguments are passed in the order: `n`, `arr`, `k`.\n\nYour task is to write the function `findMinMaxSums` which computes the maximum and minimum possible sums of the elements in the `array` after having discarded exactly `k` elements. Return these numbers in an `array`: `[max, min]`. You should not use any sorting library functions.\n\n## Example 1\n\nInput:\n\n- `n` = 5\n- `arr` = 1 2 3 4 5\n- `k` = 1\n\nLogic:\n\n- Remove the lowest number.\n- The maximum amount is: 2 + 3 + 4 + 5 = 14.\n- Remove the highest number.\n- The minimum amount is: 1 + 2 + 3 + 4 = 10.\n- Output: 14 10\n\n## Example 2\n\nInput:\n\n- `n` = 3\n- `arr` = 5 6 7\n- `k` = 2\n\nLogic:\n\n- Remove the two lowest numbers: 7\n- Remove the two highest numbers: 5\n- Output: 7 5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoanttila%2Ffindminmaxsums","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimoanttila%2Ffindminmaxsums","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoanttila%2Ffindminmaxsums/lists"}