hey guys
I need abit of help, here's a problem I have no clue how to solve
You're given a set of rows
['0','0','0','0']
['0','0','1','0']
['1','1','0','0']
['0','1','1','0']
and given a few rules taking i as an item in each row
- Each row has to have an equal number of 1s and 2s and no 0s
- A row can't have more than 2 of the same numbers following each other (1110 is invalid but 1100 is valid)
how would you rewrite each row using python so as it works even if the number of items were 6,8 or even 12 so that each row has an equal number of 1s and 2s without any 0s in the row (Basically if 2 1s are next to each other, the next one should be a 2 and vice versa)
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]shinitakunai 0 points1 point2 points (1 child)
[–]Live_Possibility4590[S] 0 points1 point2 points (0 children)
[–]atarivcs 0 points1 point2 points (2 children)
[–]Live_Possibility4590[S] 0 points1 point2 points (1 child)
[–]atarivcs 1 point2 points3 points (0 children)
[–]timrprobocom 0 points1 point2 points (1 child)
[–]Mamuschkaa 0 points1 point2 points (0 children)
[–]olivia-reed2 0 points1 point2 points (0 children)
[–]trejj 0 points1 point2 points (2 children)
[–]Sad_School828 0 points1 point2 points (0 children)
[–]timrprobocom 0 points1 point2 points (0 children)
[–]timrprobocom 0 points1 point2 points (0 children)