Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Apparently, graph walking is not necessary for this problem, there are very few path strategies for a symmetric web.
Problem description is too vague and uncertain. Not a single mention of the desired result. It was just broken code, comments and some clues from tests. Please improve the description, at least to the level when it's possible to think of solution without starting the kata and looking at the unfinished code.
It's not algorithm problem, it's pure math. Suggest to remove tag
Algorithms
, add tagMathematics
and reduce difficulty level to7 kyu
.This comment is hidden because it contains spoiler information about the solution
.
approved by someone
Fork published
Fork of
eurydice5717
's translation that resolves this issue caused by overflow. Each call to generate a random value now constructs its own int distribution, removing the arithmetic and guaranteeing that the numbers are in range.C++ version. Contrary to the description, negative arguments are fed to the function.
The expected results for negative fractions look strange:
Incorrect result for fractionToPeriodic(-1689246217, 36291): Expected: equal to "-46547.(-2-4-90-9-7-5-7-2-400-...)"
Approved
C++ translation waiting for comments or ... approval :-)
This is by far the most performant and elegant solution.
Horrible solution. Perfect example of how to kill performance by making code shorter. Solutions here are expected to have
O(n)
and compete only in number of passes through the list, but this one manages to get toO(n^2)
.I don't think modular arithmetics is basic math, but I guess that is a matter of perceptioin.
That kata now already has a Java translation. Also this kata requires to merge the frequency count and prime factors in string format, so technically not an exact duplicate.
Also, duplicates of Prime Factorization katas has been mentioned here and will be handled sooner or later.
Loading more items...