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.
OP solved it, closing
Have you tried it on paper for a couple of inputs? The pattern is obvious after a few iterations.
+1
It means "how many pairs of integers
(a,b)
satisfies the system of equations".It's perfectly clear to people who have at least been taught a bit of linear algebra.
Yes, but probably not in the way you would've initially thought.
@aoben3 how did you fix the java heap space? What was the problem? I have a similar issue.
This picture makes really good explanation.
http://glaringnotebook.com/zimages/cubism38.jpg
The big cube on the picture above has 3 cubes in a row.
Hope it helps.
A cube has six sides that are visible from outside. Your task is to count all the cubes that are inside.
Example for 3: 3x3x3 (=27) smaller cubes.
3 cubes width, 3 cubes high and 3 cubes deep.
Or 3 layers of 3x3.
First layer:
███
███
███
Second layer:
███
█X█ <--- the X isn't visible from outside
███
Third layer:
███
███
███
Hi-I had a hard time solving this too, I didn't really understand the question and had a hard time visualizing it. One thing that helped me was to look at diagrams of 2 cubed, 3 cubed, etc. You'll see that 2 cubed has zero rows in between, but that 3 cubed has 1 row between. 4 cubed has 2 rows in between. Hope this helps you a bit!
This comment is hidden because it contains spoiler information about the solution
If a is [1, -1] you get infinite loop.
I had the same problem. I commented my System.out.print() (debug purpose) and heap space issue was fixed.