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.
closing
This is just feedback, I might try again. The question is slightly vaguely phrased. I spent a long time working on it, only to discover that the description of roman numerals on wikipedia is subtly different. The description of roman numerals on wikipedia is that they are subtractive from the right, rather than additive from the left. This results in a difference in the number 789 ('DCCXXCVIIII' obtained by my program that works correctly on the two asserts in the test run but not this number versus the correct number given by wikipedia which is DCCLXXXIX.) It's unfortunate that I spent so much time going down the wrong road before realizing that the actual description of roman numerals is a little bit different. I realize there isn't much space to describe it. Thanks!
S Dorsher
Use markdown formatting to post your code here. The label for C++ is cpp
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
WOW!!!! I usually have very verbose code but yours is definitely off the charts. You should take a close look to the experienced guys' solutions and learn from there. And in this particular one, you're inventing the wheel when it's already invented long time ago. You are calculating the GCD from scratch and in not an efficient way instead of using the built-in function. Python comes with batteries included so take advantage of them!!!
Few things hit me with that code
sign = (-1) ** i
.round(numpy.linalg.det(numpy.matrix(a)))
but I think that defeats the purpose of a Kata :-)I hope my comment is helpful.
p.s. I learnt from one of previous kata that in python if you want to remove an n'th element from an array/row you can use something like :
row = row[:n] + row[n+1:]
Currently numpy module version is 1.14, so no lcm.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Python works fine. If you have a problem with your code, raise an question instead of an issue.
It would be much easier to help you if you formatted your code properly with markdown: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting
From just looking at your code, it seems like you're overcomplicating the problem. You might find it benificial just to take a step back and think about what you actually need to do to solve the kata.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This kata is fun because it leaves room for clever mathematically solutions. I particularly enjoy those, being a numerical programmer.