Skip to content

Hw30#19

Open
VS-Ivanov wants to merge 3 commits into
masterfrom
hw30
Open

Hw30#19
VS-Ivanov wants to merge 3 commits into
masterfrom
hw30

Conversation

@VS-Ivanov
Copy link
Copy Markdown
Owner

No description provided.

vadim.s.ivanov added 3 commits October 9, 2023 20:41

public /*static*/ int[] getArrAfterLastOne(int[] arr){
int lastOneIndex = -1;
for(int i=0; i<arr.length;i++){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут можно чуть-чуть поиск соптимизировать, идти справа налево и при первой найденной единице сразу делать брейк, но это мелочи

Copy link
Copy Markdown
Owner Author

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