Could you ask that question directly on a solution you don't understand? That makes things easier to explain. Ask questions that are as specific as possible; tell us what syntax you understand and what you do not.
realDenom is being computed with the wrong value. The common denominator of all pairs should still be obtained correctly, but not necessarily simplified.
it does require a lot of code, but there is no difficult algorithm to come up with, you have a list of rules that translate relatively straightforwardly to code. as long as you are organized, you will make incremental progress and eventually succeed. in constrast, higher-ranked katas often require you to devise a complex algorithm, make some research, optimize your code and so on, things on which you can get stuck for a long time without making any progress until you have a sudden inspiration or make a discovery.
Another problem is that it is inherently hard to evaluate the difficulty of something. proficient people will tend to underrank, beginners will tend to overrank. And specifically on Codewars, ranks cannot be changed after approval, and there has been a continual rank deflation over the years (kata tend to be ranked lower and lower, i.e. higher kyu)
You can do it, but it's usually more common to iterate array.. to manipulate local variables and considerer this like condition to stop is more like the While ..
Could you ask that question directly on a solution you don't understand? That makes things easier to explain. Ask questions that are as specific as possible; tell us what syntax you understand and what you do not.
realDenom
is being computed with the wrong value. The common denominator of all pairs should still be obtained correctly, but not necessarily simplified.No, so when reaching the right-most
p
, you jump out of surface, even if there is anotherq
to your right. Equivalent forq
in other direction.it does require a lot of code, but there is no difficult algorithm to come up with, you have a list of rules that translate relatively straightforwardly to code. as long as you are organized, you will make incremental progress and eventually succeed. in constrast, higher-ranked katas often require you to devise a complex algorithm, make some research, optimize your code and so on, things on which you can get stuck for a long time without making any progress until you have a sudden inspiration or make a discovery.
Another problem is that it is inherently hard to evaluate the difficulty of something. proficient people will tend to underrank, beginners will tend to overrank. And specifically on Codewars, ranks cannot be changed after approval, and there has been a continual rank deflation over the years (kata tend to be ranked lower and lower, i.e. higher kyu)
'
This comment is hidden because it contains spoiler information about the solution
我使用for显示超时
god bless you)
Thank you!
omg, thanks for explaining
Thank you lmao.
You can do it, but it's usually more common to iterate array.. to manipulate local variables and considerer this like condition to stop is more like the
While
..