-
-
Notifications
You must be signed in to change notification settings - Fork 106
feat: menambahkan algoritma lucky number #339
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Langkah awal pencarian lucky number adalah mengeliminasi semua bilangan genap, jadi angka 80 seharusnya bukan lucky number. Silakan cek kembali logikanya agar sesuai sebagaimana definisinya di Lucky Number
@sejutaimpian bisa di cek lagi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saya mencoba mengecek angka 9 untuk memastikan bahwa angka 9 adalah lucky number tapi ternyata hasil dari program menampilkan "Bukan Angka Lucky".
Ini terjadi karena pada iterasi kedua idx bertambah sehingga melewatkan angka 3.
Simulasi
Pada iterasi pertama:
nbr = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, ...
idx = 1
step = 2
Maka akan menghapus semua bilangan genap.
Pada iterasi kedua:
nbr = 1,3,5,7,9,11,13,15, ...
idx = 2
step = 5 ini yang jadi masalah karena dia skip angka 3
Solusi terbaiknya adalah langsung saja nbr nya diisi oleh bilangan ganjil. Atau kalau kamu masih mau tetap seperti itu, silakan perbaiki agar logic nya terpenuhi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, terima kasih atas kontribusinya @Ateng-labrador
@bellshade/python-team |
build fail |
@sejutaimpian baik terimah kasih atas masukannya 🙏 🙏 |
Deskripsi (Description)
Disini saya menambahkan algoritma baru pada dictionary
other
tentang lucky number/Angka keberuntunganChecklist:
Umum:
Contributor Requirements (Syarat Kontributor) dan Lain-Lain:
Unit Testing dan Linting:
Environment
Saya menggunakan (I'm using):
os
=windows
python
=py -3 -V (Windows-Python launcher)
linked issue #