Skip to content

Conversation

AHTHneeuhl
Copy link
Contributor

Important

Please make sure the file name is lowercase and a duplicate file does not already exist before merging.

let count = 0;
let result = 0;

for (let right = 0; right < s.length; right++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion: Use while loop for sliding window

Suggested change
for (let right = 0; right < s.length; right++) {
let [ left, right ] = [ 0, 0 ];
while (right < s.length) {
if (canSlide) {
left += 1;
}
right += 1;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aakhtar3 I have updated the code

@AHTHneeuhl AHTHneeuhl requested a review from aakhtar3 August 6, 2023 11:35
@AHTHneeuhl AHTHneeuhl closed this by deleting the head repository Oct 28, 2023
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