Skip to content

Conversation

jillirami
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Thanks for getting this in Jillianne. It looks good, you hit all the learning goals here. Well done.

previous = nil
current = @head

until !current

Choose a reason for hiding this comment

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

👍

# Space Complexity: O(1)
def find_nth_from_end(n)
raise NotImplementedError
length = self.length

Choose a reason for hiding this comment

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

You can actually do this without having to traverse the list twice.

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