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.
The
suggestion
tag is for suggestions regarding the kata itself, not for the users.Thanks for the video though :)
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 solution can be done with a O(1) time complexity. I recommend watching a mathmeticians video on what makes vectors Collinear, it can be explained in under 2 minutes. After some research, the translation for code implementation should be simple for most.
For example, I consulted this video and it helped me understand what makes collinearinty in a more concise manner than the provided link:
https://www.youtube.com/watch?v=egHYp65nuUQ
same lol
This comment is hidden because it contains spoiler information about the solution
Sorry, but I don't understand what to do and what you want, worse, I don't understand the solution, not 8kyu.
Approved
Lua translation!
@Yushi.py thanks!
(yes i was using c++ btw)
I read Stroustrup's book from beginning to end (which is easy), although now it's all covered in dust, and I'm learning mathematics for data analysis.
I think it's time to repeat the syntax to maintain the image :)
When I first saw your name, I thought you were a full on C++ programmer from your name, looks can be deceiving.
hmm... but once upon a time I knew the C++ syntax, that's what Python does with people :)
JS's
Number
data type would also give1 / 2 === .5
, thoughBigInt
would give1 / 2 === 0
.This has nothing to do with C++, Python, or the actual issue, I just wanted to throw out there that it's not just Python. Generally, being aware of your datatypes and the typing of your operators is A Good Thing.
Hi @mosstruck. Please mention the language you're using so we can better help you with your problem.
Though, through the littlest of stalkings, I'd infer you're using C++.
You should note that when you do something like
x1 / x2
and bothx1
andx2
are integers, their result will also be an integer rather than a float, so1 / 2
will result in0
, rather than0.5
. The only language I know that resolves this to0.5
is Python. I suppose this caused @CatPlusPlus's confusion.As to resolving the task, you could try turning one of the values to a float or rewriting the expression in a way that doesn't use a division; that's up to you.
Loading more items...