8 kyu
Be Concise II - I Need Squares
1,897 of 1,898donaldsebleung
Loading description...
Refactoring
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.
That was fun! But I feel dirty now.
Python translation Python 3.8
Something happened with the kata. It doesn't work anymore. It is impossible to choose JavaScript language - the dropdown menu is empty. Is it a temporary glitch?
It works fine for me. But I've seen that behaviour with some other kata before, for me it was this one: https://www.codewars.com/kata/pascals-triangle/ and for others it works just fine.
It is strange. I solved the kata (now everything is fine). I've checked your link and there are no issues (on my account), however this one persists to be broken https://www.codewars.com/kata/who-is-going-to-pay-for-the-wall/train/javascript probably for all users.
In that kata the removal of some comments in discussion seems to be the culprit.
This comment has been hidden.
This comment has been hidden.
My solution counts 43 characters, your output shows more than 100 (~ 112? don't remember exactly) - litte bit strange;-)? PS: Congrats to your top 100;-)!
use this in example testcase: console.log((squaresOnly+"").length)
see yuor code: console.log(squaresOnly+"")
Yes... but this is not the number of "typed code- characters". Says 100 but counting the characters gives 38;-)
I get what you mean. For functions
toString()
doesn't work as straightforward compared to other data types (such as integers, floats or booleans) because the compiler has to compile the code before it can convert the function to a string. This results in anomalies in character count. For example, arrow functionsparam => { ... }
are converted into ordinary function formatfunction (param) { ... }
in thetoString()
process which increases character count. ThetoString()
for functions also exhibits some unexpected behaviour such as interpreting tail recursion as a type ofwhile
loop (just read the comments in my first Be Concise kata - I had to disable an anti-cheat test because it was unexpectedly invalidating valid solutions).I wish I could fix that.
BTW, thanks (about the top 100 thing) :D
;-)... and thanks for your explanation... it was very noticeable that the character count wasn't "ok", independet from the reason for it (thought in this way, but wasn't so important because the solution was "ok").
Look out....Donalds on the Leaderboard.. :)
Thanks :)