I have the following problem and any help would be appreciated. Let’s assume we have the following (n x 3) array:
["Skyfall", "Monday", "21:00",
"Batman Rises", "Wednesday", "22:30",
"Skyfall", "Tuesday", "23:00",
"The Avengers", "Thursday", "22:45",
"Skyfall", "Monday", "21:00"
"Batman Rises", "Wednesday", "22:30",
"Batman Rises", "Wednesday", "22:00",
. . .
. . .
. . .]
Each row is represented by three Strings. I want to implement an algorithm that is grouping common rows, in the following way.
When the algorithm starts it first checks all the values in the first column of the two dimensional array. Then if it finds same values there, it continues with the second column but it only checks the rows which have the same value in the first step. After that, it continues with the third column in the same motive. At the end it gives the rows that are found by the above procedure.
For example for the given array the output should be:
[“Skyfall”, “Monday”, “21:00”,
“Batman Rises”, “Wednesday”, “22:30”]
Have you got any idea of how i could do that?
Thank you very much!
Movieclass, with three members:movieName,day,timeAfter that, feel free to put the results back into an array if you like.