Skip to content

Conversation

@OhCloud
Copy link

@OhCloud OhCloud commented Nov 14, 2019

in progress (so sorrrry)

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.

It's not great, but you did have some working here. We'll go over things in class. This is something to practice in preparation for interviews, you're somewhat likely to get a recursive question.

if s.length == 1 #basecase
return s
else
return reverse(s[1..-1]) + s[0]

Choose a reason for hiding this comment

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

Missing an end to this if statement.

Suggested change
return reverse(s[1..-1]) + s[0]
return reverse(s[1..-1]) + s[0]
end

if count == 0
return false
elsif s.even?
s.reverse + s(count -1)

Choose a reason for hiding this comment

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

You're going to need to do something to reverse instead of using the .reverse method.

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