Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Challenge 13 (Pending) #420

Merged
merged 3 commits into from
Jan 23, 2017
Merged

[Python] Challenge 13 (Pending) #420

merged 3 commits into from
Jan 23, 2017

Conversation

alexbotello
Copy link
Contributor

We have our function take the integer input and convert it into a list of
integers. We find the number of digits, the midpoint, and then separate both
halves of the list.

If the number of digits is even, reverse the second half and compare it to the first. If number of digits are odd, follow the same steps, but be sure to add +1 to the index of the first half.

Copy link
Collaborator

@slandau3 slandau3 left a comment

Choose a reason for hiding this comment

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

You definitely have the right idea but there is another way you should look at this. As it stands you are using O(n) space but you could do it using O(1). Try to rethink how your doing this, instead of using a list, try using something else like say another int.

@alexbotello
Copy link
Contributor Author

Okay, I ditched the list implementation altogether and decided to reverse the int using %10

@alexbotello alexbotello changed the title [Python] Challenge 13 (Unreviewed) [Python] Challenge 13 (Pending) Jan 21, 2017
@slandau3 slandau3 merged commit 84e242c into YearOfProgramming:master Jan 23, 2017
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.

None yet

2 participants