Calculating the number of square submatrices with all ones. [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question











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
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 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

















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.







share|improve this question











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
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 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













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.







share|improve this question











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.









share|improve this question










share|improve this question




share|improve this question









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
If this question can be reworded to fit the rules in the help center, please edit the question.




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
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 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




    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
















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Greedy Best First Search implementation in Rust

Function to Return a JSON Like Objects Using VBA Collections and Arrays

C++11 CLH Lock Implementation