Programming puzzles: processing lists!
|
05-05-2017, 07:32 PM
Post: #73
|
|||
|
|||
RE: Programming puzzles: processing lists!
(05-05-2017 11:51 AM)pier4r Wrote: So first I had to handle the case that the second dosubs returns a list of only one element, that \GSLIST does not like, If I understood your comments correctly. Therefore I add a 0 to the list returned by dosubs and GSLIST likes it. Yes, I can't believe I missed that in the version that I copied into the last post. I cleaned it up a bit and went ahead and simply returned 0 (invalid) or 1 (valid) in this version: Code: \<< (05-05-2017 11:51 AM)pier4r Wrote: If I am not mistaken. The list { 5 5 5 5 5 6 6 6 6 6 } is returned as valid, but it is not. I don't understand why those two lists should be considered invalid. Your original challenge for #6 says "verify that every integer in the list appears the same amount of times". Doesn't every integer appear the same number of times in both of those lists? What am I missing? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)