Calculating the number of square submatrices with all ones. [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
-6
down vote
favorite
This is my program implementation using DP. I don't know if my approach is correct or not. I would appreciate any feedback.
In a matrix given below, we have 8 square submatrices, (seven 1 X 1 square matrices), and one 2 x 2 square matrix whose values are all ones.
1 1 0
0 1 1
1 1 1
This is my java implementation
static int subMatrixOrPrimeNumbers(int matrix) matrix.length == 0
This works for one array, but has failed for other arrays. I don't know what I am doing wrong.
java dynamic-programming
closed as off-topic by Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno Jul 31 at 13:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." â Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno
add a comment |Â
up vote
-6
down vote
favorite
This is my program implementation using DP. I don't know if my approach is correct or not. I would appreciate any feedback.
In a matrix given below, we have 8 square submatrices, (seven 1 X 1 square matrices), and one 2 x 2 square matrix whose values are all ones.
1 1 0
0 1 1
1 1 1
This is my java implementation
static int subMatrixOrPrimeNumbers(int matrix) matrix.length == 0
This works for one array, but has failed for other arrays. I don't know what I am doing wrong.
java dynamic-programming
closed as off-topic by Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno Jul 31 at 13:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." â Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno
3
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59
add a comment |Â
up vote
-6
down vote
favorite
up vote
-6
down vote
favorite
This is my program implementation using DP. I don't know if my approach is correct or not. I would appreciate any feedback.
In a matrix given below, we have 8 square submatrices, (seven 1 X 1 square matrices), and one 2 x 2 square matrix whose values are all ones.
1 1 0
0 1 1
1 1 1
This is my java implementation
static int subMatrixOrPrimeNumbers(int matrix) matrix.length == 0
This works for one array, but has failed for other arrays. I don't know what I am doing wrong.
java dynamic-programming
This is my program implementation using DP. I don't know if my approach is correct or not. I would appreciate any feedback.
In a matrix given below, we have 8 square submatrices, (seven 1 X 1 square matrices), and one 2 x 2 square matrix whose values are all ones.
1 1 0
0 1 1
1 1 1
This is my java implementation
static int subMatrixOrPrimeNumbers(int matrix) matrix.length == 0
This works for one array, but has failed for other arrays. I don't know what I am doing wrong.
java dynamic-programming
asked Jul 31 at 9:10
Kartik
892
892
closed as off-topic by Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno Jul 31 at 13:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." â Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno
closed as off-topic by Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno Jul 31 at 13:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." â Heslacher, Peter Taylor, ÃÂìýÃÂñ á¿¥Ã栨Â, Ludisposed, Dannnno
3
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59
add a comment |Â
3
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59
3
3
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
3
Code not implemented or not working as desired: This belongs on SO, where they take questions about code not working.
â FreezePhoenix
Jul 31 at 11:59