Skip to content

Update removeEvenLength.java#9

Open
tech127 wants to merge 1 commit intoCreede15:masterfrom
tech127:patch-3
Open

Update removeEvenLength.java#9
tech127 wants to merge 1 commit intoCreede15:masterfrom
tech127:patch-3

Conversation

@tech127
Copy link

@tech127 tech127 commented Feb 16, 2021

can you pls increase (word.length() % and display. learning curve

@tech127 tech127 closed this Feb 16, 2021
@tech127 tech127 reopened this Feb 16, 2021

for (int i = 0; i < array.size(); i++) {
String word = array.get(i);
ii String word = array.get(i);

Choose a reason for hiding this comment

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

you don't need this line. repeated.

if (word.length() % 2 == 0) {
array.remove(i);
i--;
array.remove(i);

Choose a reason for hiding this comment

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

you don't need this line

array.remove(i);
i--;
array.remove(i);
i--;

Choose a reason for hiding this comment

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

don't need this line

ii String word = array.get(i);
if (word.length() % 2 == 0) {
array.remove(i);
i--;

Choose a reason for hiding this comment

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

}

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.

2 participants