On researching bitwise operators it seems they apply to binary digits not decimal digits. I understand the output of OR is 1 if either of the inputs are 1 and 0 if both of the inputs are 0. How does this apply to decimal digits?
(or [4, 5] [2 3 1 0 6 0 5 6 2 3]) -> [2 3 1 0 6 0 5 6 6 7] can only work if you pad the zeros at the start BUT
(or [1 2 3] [1 2]) -> [1 2 3] can only work if you pad the zeros at the end...
Wat kinda trickery is dat ?
Agreed, I had thought about this but understood that it wouldn't cut the mustard.
This solution is illegal
I was so frustrated trying to figure this out. Gave in and tested the top rated solution only to get this. Way she goes.
or '--5'
nice how such riddles can actually teach people things better than any university
dud i'm not gona waste 15 minute to learn some stuf not gonna add any knolage to me to just solve one single keta!!!
i feel f stupid after seeing this.
I made the same mistake. It is:
"true if the sum of the squares of each element in a is strictly greater than the sum of the cubes in b." So cubes for "b" not squares.
On researching bitwise operators it seems they apply to binary digits not decimal digits. I understand the output of OR is 1 if either of the inputs are 1 and 0 if both of the inputs are 0. How does this apply to decimal digits?
Can you check your clojure solution
(or [4, 5] [2 3 1 0 6 0 5 6 2 3]) -> [2 3 1 0 6 0 5 6 6 7] can only work if you pad the zeros at the start BUT
(or [1 2 3] [1 2]) -> [1 2 3] can only work if you pad the zeros at the end...
Can someone explain this test case to me please ?
The
[4 5]
gets padded to[4 5 0 0 0 0 0 0 0 0]
since their is no default provided. Then we OR each element
How is
4 or 2 = 2
, How is5 or 3 = 3
?I would have thought the result here should have been
What am I misunderstanding?
I thought maybe it wanted padded on the left, but there is another test case
And if we pad on the left, that test case breaks. As you would have to pad on teh right to get that result.
This is in the Clojure version.
I say so!
Stupid condition, nothing is clear from it (((
Who talks like that?! The whole description is awful...
Format Specification Mini-Language
Loading more items...