Skip to content

Add lucky numbers #32

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

Closed

Conversation

richardhozak
Copy link

@abranhe
Copy link
Member

abranhe commented Oct 4, 2018

Hi @Zxey I liked, but it seems that the algorithm isn't properly implemented.

According to this the following gif:

gif

From 1-100 the lucky numbers should be:

1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99

This is the link to your implementation repl.it/@abranhe/lucky-numbers-in-python online, I just set the range from 1 - 100.

In a part of the output you will see:

number 17 is not lucky
number 18 is not lucky
number 19 is lucky
number 20 is not lucky
number 21 is not lucky
number 22 is not lucky
number 23 is not lucky
number 24 is not lucky
number 25 is not lucky
number 26 is not lucky
number 27 is lucky
number 28 is not lucky

Where they don't match with the output it should be:

Eg:

  • 19 isn't lucky
  • 25 is lucky
  • 27 isn't lucky
  • and so on ...

So this need to be fixed to be merged, I am creating an issue right now, hopefuly we will implement correctly.

@abranhe abranhe added invalid This doesn't seem right needs changes labels Oct 4, 2018
Copy link
Member

@abranhe abranhe left a comment

Choose a reason for hiding this comment

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

Needs changes see #32 (comment)

@richardhozak
Copy link
Author

Fixed lucky numbers implementation as per AllAlgorithms/cpp#83 implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right needs changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy