Do you get an error message?
Type: Posts; User: Norm
Do you get an error message?
Which index was out of bounds?
Add a println that prints out the values of the indexes so you can see.
What happens when the code is executed?
Use the Arrays class's toString() and deepToString() methods to format the arrays for printing before and after those methods execute to see what they are...
I'd use normal indexes to go through the 2Dim array and Have a separate index for the 1 Dim array
The 1Dim array would need its own index, separate from the indexes for the 2Dim array.
With loops and indexing. If you can write the code in post#15, it shouldn't be hard to write code to convert an array's dim from 2 to 1 and back.
Can a 1Dim array be used to create a 2Dim array? Your earlier post showed a 2Dim array that looked like each row was a section from a 1Dim array.
For example:
0 0 0 0 0 1 0 1 1
would fold to:
...
Please edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.
Also can you post a small. complete program that compiles and executes?
I've...
Get a working part for now and come back to it later.
You won't know that until you find a better solution.
There is always more than one way. Solve it now, improve it later.
Do that and discard those with the wrong number of 1s
Why a 2D array? The rows of the 2D array concatenated together make a single row to hold the number. first row + second row + third row = the number as 1D
What problems are you having? Do you...
Not sure how that works. What are the rows and the columns?
How would 01101 be stored in a 2D array?
What code do you have so far?
I'm not sure I understand k: k=number places with value "1"
What is a "place"? One of the slots in the array?
Do the slots in the array hold a single bit with a...