Skip to content

Find middle characters for odd and even words.#141

Open
JoseTorrez wants to merge 1 commit intodevelopfrom
josetorrez_get_the_middle_character
Open

Find middle characters for odd and even words.#141
JoseTorrez wants to merge 1 commit intodevelopfrom
josetorrez_get_the_middle_character

Conversation

@JoseTorrez
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Sep 4, 2017

Codecov Report

Merging #141 into develop will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #141      +/-   ##
=============================================
+ Coverage      87.84%   87.93%   +0.09%     
- Complexity       456      459       +3     
=============================================
  Files            103      104       +1     
  Lines            987      995       +8     
  Branches         161      162       +1     
=============================================
+ Hits             867      875       +8     
  Misses           106      106              
  Partials          14       14
Impacted Files Coverage Δ Complexity Δ
...ain/java/org/fundacionjala/coding/jose/Middle.java 100% <100%> (ø) 3 <3> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba1f59d...16619ce. Read the comment docs.

} else {
subWord = word.substring(half, half + 1);
}
return subWord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be refactored like this.

        int half = word.length() / 2;
        return word.length() % 2 == 0 ? word.substring(half - 1, half + 1) : word.substring(half, half + 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants