I am trying to access elements in a DArray (which I have created by copying elements from a linked list) 3 at a time, searching for sets of 3 consecutive 1s and 0s. For ex: if indices 0 through 2 hold the values of 1 1 1, my output would be a 1. If indices 3 through 5 hold the values 0 0 0, my output would be 0. If indices 6 through 8 hold a mixture of 1s and 0s, the output would be nothing. I've tried several approaches and cannot seem to find one that works right. Does anyone have any ideas? This is not a homework assignment.
Aucun commentaire:
Enregistrer un commentaire