Title: Fix palindrome substring end index, correct length variable, and improve majority-element test by Etherstrings · Pull Request #1 · Etherstrings/Algorithm · GitHub
Open Graph Title: Fix palindrome substring end index, correct length variable, and improve majority-element test by Etherstrings · Pull Request #1 · Etherstrings/Algorithm
X Title: Fix palindrome substring end index, correct length variable, and improve majority-element test by Etherstrings · Pull Request #1 · Etherstrings/Algorithm
Description: Motivation Correct incorrect substring end handling in the longest-palindrome implementation so returned results match expected inclusive end indexing. Fix a spelling/variable-name issue in the squared-length helper to improve clarity. Reduce space usage of the majority-element routine to O(1) and add runtime assertions to strengthen the test coverage. Description Updated L5_LongestHuiwen.longestPalindrome to use maxLength (renamed from maxlenght) and return s.substring(left, right + 1) so the end index is inclusive. Fixed a typo in L593.length by renaming lenght to length and returning the computed length. Replaced a HashMap-based majority counting in Test1.getShowMoreN with the Boyer–Moore majority vote algorithm and added occurrence verification; added assertion-based test cases in Test1.main to validate behavior for several inputs. Testing No automated test suite was run in this patch; only assertion-based checks were added to src/Test/Test1.java for local verification at runtime. Codex Task
Open Graph Description: Motivation Correct incorrect substring end handling in the longest-palindrome implementation so returned results match expected inclusive end indexing. Fix a spelling/variable-name issue in the sq...
X Description: Motivation Correct incorrect substring end handling in the longest-palindrome implementation so returned results match expected inclusive end indexing. Fix a spelling/variable-name issue in the sq...
Opengraph URL: https://github.com/Etherstrings/Algorithm/pull/1
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:077cba7f-0e00-378d-221a-81ed0356f0c0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9964:2D16FA:3A2830E:52D82EB:6A5699E6 |
| html-safe-nonce | 8f8fec61fc245731b2b506c2a78754ca19a526963b798227d049c690af61a760 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTY0OjJEMTZGQTozQTI4MzBFOjUyRDgyRUI6NkE1Njk5RTYiLCJ2aXNpdG9yX2lkIjoiNTYzMTM2NDY0NzAyMDMwNDg3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 365b812851e68d86a24c695ab5cf6378b7ce4db8426f01b6759f91b23ed26aaf |
| hovercard-subject-tag | pull_request:3239878661 |
| 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/Etherstrings/Algorithm/pull/1/files |
| twitter:image | https://avatars.githubusercontent.com/u/95729350?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/95729350?s=400&v=4 |
| og:image:alt | Motivation Correct incorrect substring end handling in the longest-palindrome implementation so returned results match expected inclusive end indexing. Fix a spelling/variable-name issue in the sq... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 647a25f437e2f54eccdd162bd007c8ae70f4235c4125dba0f4518747cc8b9615 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Etherstrings/Algorithm git https://github.com/Etherstrings/Algorithm.git |
| octolytics-dimension-user_id | 95729350 |
| octolytics-dimension-user_login | Etherstrings |
| octolytics-dimension-repository_id | 473093807 |
| octolytics-dimension-repository_nwo | Etherstrings/Algorithm |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 473093807 |
| octolytics-dimension-repository_network_root_nwo | Etherstrings/Algorithm |
| 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 | 05adb86a60ce3d701e556eded3ab26300ec6bcc4 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width