7 kyu
Mysterious Singularity Numbers
662 of 1,530mor1nch
Loading description...
Fundamentals
Logic
Mathematics
Arrays
Algorithms
Performance
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.
how to make the solution more efficient, if the script has a loop with a condition is not efficient enough or is giving a timeout error. please help on make an efficient script.
A hint is that your approach shouldn't use loops. Try a more mathematics-based approach.
This comment has been hidden.
OP solved it, closing
This comment has been hidden.
Please use appropriate markdown formatting when posting code. See https://docs.codewars.com/training/troubleshooting#post-discourse.
Not a kata issue, you need a more efficient solution (less lines of code doesn't necessarily mean more efficient code). See https://docs.codewars.com/training/troubleshooting#timeout.
C# Translation
Getting a timeout when submitting my solution. Since the servers are configured to handle requests for a limited amount of time, I was told to optimise my code. Changed it to a one liner and I get the same issue.
Less lines of code != more efficient code. Your code is too inefficient. See https://docs.codewars.com/training/troubleshooting#timeout.
Not a kata issue. See https://docs.codewars.com/training/troubleshooting#post-discourse.
This one drives me crazy it always outputs 1 less or 1 more than needed for some test..
RISCV Translation
Thanks!
definitely not 7 kyu
I don't agree. It's just a refinement of FizzBuzz, which is 8 kyu territory.
FizzBuzz is not an 8 kyu problem. More like a 7 kyu.
i didn't remember the mathematical formula, that made it more difficult for me
Common Lisp translation, please approve / reject.
6-5 kyu, underrated kata
6 at best, it can be brute forced.
Judging the top twenty JS solutions and my miserable tries of solving it this way, it can not be brute forced in this very language. Perhaps other languages are able to solve the mystery by this type of approach.
my brut force on python run off time with huge numbers. if they are excluded, it would be probably 8 kyu.
This would be 7 kyu if it didn't have the performance constraint.
Saying that this kata is simple is rather a misnomer. Definitely not a 7kyu. Might be easy for you if you remember a very specific math lesson from school. Otherwise there is no chance to deduce the solution.
This comment has been hidden.
If you're at 2 Dan with 3000 Katas solved, I'm sure.
But this is marked 7 kyu, which is absurd.
My initial solution in Python is a bruteforce, and it passed. So you don't even need to be as smart as the user above to be able to solve this kata.
how the result here is 10!!!!!! [40, 10] 10/5 = 2 10/2 = 5 anyone expalin ????!!!!!!!
Read this again:
There are 10 numbers <= 40 that satisfy that condition.
I got it thank you so much
Here are all the natural numbers not exceeding 40 that are not divisible by 2, 3, or 5 without a remainder:
1, 7, 11, 13, 17, 19, 23, 29, 31, 37
These numbers are not divisible by 2, 3, and 5 without any remainder.
nice kata .
This comment has been hidden.
This comment has been hidden.
that's only one of the possible solutions
Not 7 kyu
I missed it at school (I skipped it) and how now I had to suffer to find a solution
I solved it but i keep get "Execution Timed Out (12000 ms)" so i am not able to upload my solution, Any suggestion!
Probably you have an inefficient solution running in O(n) time, perhaps because you are creating a list or iterating through a range of numbers. I would suggest you look up "set theory", especially for intersection and union of multiple sets. A good solution should run in constant time, which means you probably want a formula. good luck
I had the same error as you. A simple test, I passed successfully, but with a full test, I got the same error. I also thought that I wrote everything correctly. Further, I printed out those numbers that are sent to me in "n" and after I saw the number that was sent to me in "n", I started trying to work with it on my local computer.
For example, how does my code process the number 9999919 and what is the speed of getting the result...
So it turned out, with huge numbers, my code worked slowly. I had to further refine it so that it works well with HUGE numbers.
It's possible, you can do it! Wish you luck.
it`s harder than I thought
This is not 7kyu
C Translation
I don't understand how to solve it, hint please...
one line solution. formula similar to (A U B U C)
This comment has been hidden.
Because its very, very, very, very inefficient. There is 100 tests going up to 1_000_000_000.
ty
TS translation, please review and approve.
Approved by someone.
I approved the translation, thanks a lot!
This comment has been hidden.
Unfortunately, your code is too long because of the "for". in this problem it is enough to come up with a formula that allows you to pass all the tests :)
Nice kata! Thanks mor1nch!!
i thought i did best, but others done better!!
Please review: C++ Translation
Fork
Some kind of merge conflict so had to fork, but approved, thanks!
This comment has been hidden.
set to 1e9
That was interesting, thank you.
It looks like I took the performance constraint a bit too seriously though.
Did you intend any performance constraints?
Yes, added to the condition
Again, try to think of a formula that will shorten your solution and help you pass big tests.
Are there big tests? All current solutions still seem to pass.
I have changed the tests a bit, the maximum limit is 10^4
slow solutions still pass in a couple of seconds.
changed the tests to the maximum value of 10^9
great,
performance
tag should be addedokay
No sample tests
Sry, fixed