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
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:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
If you use a TreeSet, why do you check if the String is allready in the TreeSet before adding it?