Title: perf: optimize factor calculation by oozan · Pull Request #1910 · TheAlgorithms/JavaScript · GitHub
Open Graph Title: perf: optimize factor calculation by oozan · Pull Request #1910 · TheAlgorithms/JavaScript
X Title: perf: optimize factor calculation by oozan · Pull Request #1910 · TheAlgorithms/JavaScript
Description: Description Optimizes factor calculation by examining divisor pairs only up to the square root of the input. This reduces the running time from O(n) to O(sqrt(n)) and avoids allocating an intermediate array containing every integer up to the input. Results remain sorted, and perfect-square roots are not duplicated. Testing Added exact-result coverage for one, composite numbers, a perfect square, and a prime Added invalid-input coverage Ran direct Node.js algorithm checks successfully Full formatting and test suites will run in GitHub CI AI assistance was used to prepare this focused change. I reviewed and validated the implementation.
Open Graph Description: Description Optimizes factor calculation by examining divisor pairs only up to the square root of the input. This reduces the running time from O(n) to O(sqrt(n)) and avoids allocating an intermedi...
X Description: Description Optimizes factor calculation by examining divisor pairs only up to the square root of the input. This reduces the running time from O(n) to O(sqrt(n)) and avoids allocating an intermedi...
Opengraph URL: https://github.com/TheAlgorithms/JavaScript/pull/1910
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1075872b-1c87-a979-c7de-57f8e14ca616 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A65A:1B3B59:2443E9F:31ED921:6A631594 |
| html-safe-nonce | 9c54199d403788c0223e592ff8f02178e0449f0522c986ee34c5468d92b6f80c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjVBOjFCM0I1OToyNDQzRTlGOjMxRUQ5MjE6NkE2MzE1OTQiLCJ2aXNpdG9yX2lkIjoiNzI4NzM1ODY0MzEyNTgxODc3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d7d7c2c27c0f1f30b981799dd8ad9346f7c3127e995ea8fcc5cc9260bd08e40f |
| hovercard-subject-tag | pull_request:4101342104 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/TheAlgorithms/JavaScript/pull/1910/files |
| twitter:image | https://avatars.githubusercontent.com/u/38402864?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/38402864?s=400&v=4 |
| og:image:alt | Description Optimizes factor calculation by examining divisor pairs only up to the square root of the input. This reduces the running time from O(n) to O(sqrt(n)) and avoids allocating an intermedi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 97086543 |
| octolytics-dimension-repository_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a93e25585f487ddff9e3996c06d5b869d6e1828 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width