This comment is hidden because it contains spoiler information about the solution
Rust:
From the description:
Where every ki > 1 and every ki is maximized ...
The elements in the returned vector ($k_i$) must be strictly greater than 1.
$k_i$
1
However, your vector does contain 1 at the end.
Not a kata issue.
This is exactly the reason I enjoy codewars katas so much. Learn something knew every day.
Oh, yes... I see...
but the return value will be retuned as an integer. it won't convert to a char. that's not what you want the function to do
blue_pulled and red_pulled are always lower than the blue_start and red_start (as per problem definition).
the concept is called a vacuous truth. the tests are correct
>> 1.0 / 0.0 inf >> 0.0 / 0.0 NaN
according to evcxr, which is a rust REPL
evcxr
lol i have the same problem like u bro like i don't even know why best_friend("jtekeh dek wbwclw gykc", "i", "h") should return True, even the string have no "i"
The issue is your *= for x[loop5] . just do x[loop5] * 2 so it doesn't attempt to assign it to immutable x.
Same principle if you have a scaler multiple and a vector. Used a lot in 3d models and graphics.
What happens if all the red and blue have been pulled? IE: A denom of 0?
What happens here if total is 0?
Yeah
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
Rust:
From the description:
The elements in the returned vector (
$k_i$
) must be strictly greater than1
.However, your vector does contain
1
at the end.Not a kata issue.
This is exactly the reason I enjoy codewars katas so much. Learn something knew every day.
Oh, yes... I see...
but the return value will be retuned as an integer. it won't convert to a char. that's not what you want the function to do
blue_pulled and red_pulled are always lower than the blue_start and red_start (as per problem definition).
the concept is called a vacuous truth. the tests are correct
according to
evcxr
, which is a rust REPLlol i have the same problem like u bro
like i don't even know why best_friend("jtekeh dek wbwclw gykc", "i", "h") should return True, even the string have no "i"
The issue is your *= for x[loop5] . just do x[loop5] * 2 so it doesn't attempt to assign it to immutable x.
Same principle if you have a scaler multiple and a vector. Used a lot in 3d models and graphics.
What happens if all the red and blue have been pulled? IE: A denom of 0?
What happens here if total is 0?
This comment is hidden because it contains spoiler information about the solution
Yeah
Loading more items...