First off i am sorry if this is the wrong place to post this.
Let me try to explain my problem lets say i have a 2d array 100x100 in size each cell in that array has a number from 1 to 50 randomly. How do i find the biggest subarray in a ractangle size in that array that has only n diffrent numbers.
Small example:
array: 1 2 3 3 3 2 2
7 4 3 3 4 9 8
1 2 3 3 3 4 2
7 6 1 9 9 4 2
In this case the biggest sub rectangle with only 1 number allowed would be
3 3
3 3
With 2 numbers allowed it would be
3 3 3
3 3 4
3 3 3
Does a something for this exist?
Aucun commentaire:
Enregistrer un commentaire