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.
linlux's calculation, i.e.
"interestsPerDay = 100 * 0,0098 / 360 = 0,00272222222222222222222222222222"
is not correct because interest per day is not a constant.
There is a bit of that isnt there :-)....reminds me of life at work. I've updated the description a little to hopefully make it easier to understand.
Hope you enjoyed it!
So by banks logic "in a year" means in 360 days...and it means that 6 more days are coming to finish a calendar year.
so until that you compound annually
and then daily...
Try to compound always the same way.
Yes, kind of inconsistency... but when a language has arrays easy to test the examples and the tests are
[["M: 37", "B: 5", "C: 4"], ["M: 100", "B: 14", "C: 11"]]
and when a language has arrays not so easy to test (Java in particular) the result is tested as an entire string mimicking an array so without strings inside a string...Hope it is clear enough. Anyway for a given language it is always better to look at the examples. Thanks for your post, cheers!
Thanks.
I'm glad you enjoyed it! :-)
Have a good time on CodeWars!
@linlux
I still have my old code for the bitmap reading.
If you're interested, I could provide you with it.
But doing trying to do that on your own first, should be better.
@linlux:
I did not solve it the same way.
But it's not hard to come to this solution when you understand binary and are familiar with shifting / logical operations.
It's not something you see often in Java but more in something like C or C++.
If you want to come up with solutions like that, you should try projects like reading an RLE encoded bitmap and manipulate it in C.
You can start with https://msdn.microsoft.com/en-us/library/windows/desktop/dd183392(v=vs.85).aspx
If you have any questions, feel free to contact me.
When I did something like that, it had support for 8 bit and 24 bit Bitmaps and RLE8 encoded only.
The reading and saving are about 300 - 350 lines of code.
Things you should utilize in a project like that:
You could start with something simple like calculating how often each color occurs.
If that project would be too big for you, you could also go for short bit manipulating methods.
Like writing a method that is doing a Circular Shift https://en.wikipedia.org/wiki/Circular_shift
Or write something that is doing a Circular Shift on 2 bits that run in opposite directions like this:
100000001
010000010
001000100
000101000
000010000
000101000
001000100
010000010
100000001
100000001
010000010
...
// ignore that i accidentally used 9 bits ...
Print an ascii character at the position where the 1's are and enjoy how they are moving around.
TIL: you can't reply to a reply on codewars ..
@linlux:
Alright, suppose the list of bits is
[1, 1, 0, 1, 0, 1]
and you start withint number = 0
.Here's every operation:
0 << 1 ⟶ 0
0 | 1 ⟶ 1
1 << 1 ⟶ 10
10 | 1 ⟶ 11
11 << 1 ⟶ 110
110 | 0 ⟶ 110
110 << 1 ⟶ 1100
1100 | 1 ⟶ 1101
1101 << 1 ⟶ 11010
11010 | 0 ⟶ 11010
11010 << 1 ⟶ 110100
110100 | 1 ⟶ 110101
This comment is hidden because it contains spoiler information about the solution
You're right. As every card only appears once, there is no necessity to blank sorted cards.