get longest palindrome
Updated code and added comments
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.79%. Comparing base (
a247720) to head (11bc144). Report is 3 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #704 +/- ##
==========================================
+ Coverage 94.55% 94.79% +0.24%
==========================================
Files 296 298 +2
Lines 21984 22192 +208
==========================================
+ Hits 20786 21037 +251
+ Misses 1198 1155 -43
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Why did you close #703? This PR seems to be exactly the same as #703.
#703 It's not clear why the other tests didn't pass, I didn't change any of the other code.
#703 It's not clear why the other tests didn't pass, I didn't change any of the other code.
It is just some random failure - some tests in this repository are not deterministic. In general - this is not a big deal.
I thought it was my problem.....
In any case, the question about aabb from #703 remains valid.
aabb theoretically outputs either aa or bb, here it only outputs bb
I think that should be allowed.
The code looks quite good. Please update the doc string by adding some explanation how do you find the longest palindrome, adding a sentence about non-unique solution (I guess, your function returns the one most on the right).
Also, please add a test case with "aabb" (with a suitable comment).
This compilation error is a machine problem?
@changweidalaifu6 after rethinking the whole thing, I am not sure anymore if this contribution is suitable for this repository. The problem is very specific (it is a leetcode problem after all) and quite cumbersome to state properly (well, the function should be called something like get_length_of_the_palindrome_with_max_length).
It's true that it's a bit buttoned up, but it's very tight