7 kyu
Smooth numbers
289 of 1,275GiacomoSorbi
Loading description...
Number Theory
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
i hate math
python new test framework is required. updated in this fork
Approved
"execution time out" , is my problem
It looks like your code...
-puts on sunglasses-
...isn't smooth enough.
-CSI:Miami intro theme plays-
Ruby 3.0 should be enabled.
Enabled in this fork
Why is 111 considered a non-smooth number, when its highest prime factor is 3?
No, it's 37 (and it's in the kata description)
Oh I see, I thought we were supposed to find the highest prime factor <= 7
C++ 17 should be enabled.
I really like the task, my only suggestion is that it is too clever for rank 7.
I am not the one calling the shots to rate my own katas, but this one does not seem too complicated - is it?
C# Translation added.Please review and approve~
I keep getting this when i run the sample test: "expected:humble number[] but was:humble number[s]"
I dont understand why, please help. This is for the java version!
CW GitHub Wiki - Kata Best Practices - Follow Established Conventions
[C] Function names should always be in
snake_case
notcamelCase
(source) - please change the name of the user solution fromisSmooth
tois_smooth
.Change published. Awaiting Giacomo's approval.
For the record, this may a GNU standard but it's not universal across the industry. I've worked in C/C++ for 15 years professionally. For the most part, I've used
PascalCase
for functions/structs/classes,camelCase
for variables/fields/methods, andsnake_case
for constants/macros. Never had complaints from my colleagues, clients, or employers regarding that naming convention.Also_I_hate_typing_underscores. They_are_one_of_the_more_inconvenient_key_strokes_on_the_keyboard_and_slow_my_typing_rhythm. ;-)
Thanks for the fix and your input, IIRC C++ naming conventions are all over the place (which is very frustrating IMO, same with PHP) but C naming conventions should be more rigid. Anyway, I haven't had any real industrial experience working with C/C++ so far so what do I know? ;)
Change implemented, thanks!
Just do not compare c++ to that nasty mess that PHP become over the years, please :D
@GiacomoSorbi, C & Java translations available. I updated the description on both and Java has the dependency, so approve the C first.
Regrettably the diffing algo here is not the best, so I still got the conflict; in the future I would suggest to put the changes ONLY in the last.
Well, solved forking: thanks for your work :)
why 36 is 3 - smooth number it's have [2, 2, 3, 3] 4 numbers <= 7. I don't understand.
3-smooth means the highest prime factor of the number is
3
; you don't need any prime numbers greater than3
to get36
. For example,256
is 2-smooth because it consists only of multiples of2
.It's helped me :) Thanks.
[Crystal] Submit tests contradict Kata description with regards to input range - the description says all input passed in will be an integer
> 1
but random tests sometimes generate negative numbers, e.g.:Perhaps this is due to integer overflow? ;)
Most likely; let me see if I can fix it...
Refactored, now seems fine; thanks for the precious feedback!
Great kata!
Thanks you for both your feedback and your time.
In the description the required return string I think is broken for value 7.
humble numbers are not mentioned. I did not check the link though :)
Correct.
I am just surprised no other power user noticed that before - they probably do not even bother reading the whole description anymore :D