0
Write a program that finds the row in the given NxM matrix with longest sequence that contains same values.
The "sequence" in this context means the elements that are located one after one. Input: First line contains N and M (1<=N,M<=100) Than whole matrix is given( Value of each element of the matrix is not bigger that 1000). Output: Output have to be in the following format: Longest series is in the string < row number > If no sequence can be found output: No series of equal elements Input Output 4 4 Longest series is in the string 2 1 2 3 4 2 3 4 6 1 1 1 5 2 2 1 6 What is wrong? https://code.sololearn.com/c75I2NZhq6Td/#cpp
1 Resposta
0
Your code outputs 2 for the test case you specified so why do you think something is wrong?
Were you expecting something other than 2 for your input of this?
4 4
1 2 3 4
2 3 4 6
1 1 1 5
2 2 1 6
A test case that doesn't return the expected result would be more clear.