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.
you are not alone
The question is hard to understand. Can someone give a test example with a smaller number please and/or a more dumbed down explanation? Thanks.
Follow lechevalier. I practically learnt Python from his solutions. And he is the best in onliners.
When you see a oneliner (or any code) you don't understand, copy it and make trials on your computer to figure out how it works.
my feeling exactly. i did this. how does one get to the one liners?
I was confused by the notation myself but its just what it says, a prime factors decomposition. Lets take example from description: 86240=2^5x5x7^2x11
This comment is hidden because it contains spoiler information about the solution
I feel happy if it helped you. A bijection is a strict correspondance between the elements of two sets, in programming terms it would mean that for each input there is one and only one output matching with it, and vice versa.
There exists a strict correspondance between an infix expression and the corresponding postfix expression (using mathematical terms, there exists a bijection between the two systems). Just like
2 + 7 * 5
is not the same as2 + 5 * 7
, though both evaluate to the same result, the postfix corresponding to2+7*5
is275*+
, and not75*2+
,257*+
or something else.The kata is not interested in testing if you returned any postfix expression that evaluates the same as the infix input. You must apply the rules to create the postfix expression corresponding to the infix input (this is a classical topic). All the numbers have the same order in both expressions.
I would've been in the same boat if you hadn't commented. So thanks.
The explanation could be better. I found these 2 sites helpful to gain an understanding of the problem and arriving at a solution.
https://math24.net/simpsons-rule.html
https://www.intmath.com/integration/6-simpsons-rule.php
i advise you to read about
BFS
(breadth-first search). It's really usefull and simple algorithmThe best hint may be to ignore the word
sort
from the title.This kata is quite straightforward for a 4kyu, it's hard to give a hint without spoiling the solution. Maybe you should try to solve easier katas involving binary trees or similar data structures: search for linked lists, binary search trees katas.
This comment is hidden because it contains spoiler information about the solution
Loading more items...