1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # using words instead of numbers numbers = ["hello", "this", "is", "is", "is", "is", "a", "test", "of", "using", "words"] counter = 1 prev = numbers.pop() while len(numbers) > 0 and counter < 4: next = numbers.pop() if prev == next: counter = counter + 1 else: counter = 1 prev = next if counter == 4: print "Found repeated number" else: print "No repeated number found" |
IyB1c2luZyB3b3JkcyBpbnN0ZWFkIG9mIG51bWJlcnMKbnVtYmVycyA9IFsiaGVsbG8iLCAidGhpcyIsICJpcyIsICJpcyIsICJpcyIsICJpcyIsICJhIiwgInRlc3QiLCAib2YiLCAidXNpbmciLCAid29yZHMiXQoKY291bnRlciA9IDEKcHJldiA9IG51bWJlcnMucG9wKCkKCndoaWxlIGxlbihudW1iZXJzKSA+IDAgYW5kIGNvdW50ZXIgPCA0OgogICAgbmV4dCA9IG51bWJlcnMucG9wKCkKICAgIGlmIHByZXYgPT0gbmV4dDogCiAgICAgICAgY291bnRlciA9IGNvdW50ZXIgKyAxCiAgICBlbHNlOgogICAgICAgIGNvdW50ZXIgPSAxCiAgICAgICAgcHJldiA9IG5leHQKCmlmIGNvdW50ZXIgPT0gNDogCiAgICBwcmludCAiRm91bmQgcmVwZWF0ZWQgbnVtYmVyIgplbHNlOiAKICAgIHByaW50ICJObyByZXBlYXRlZCBudW1iZXIgZm91bmQiCgo=
-
upload with new input
-
result: Success time: 0.08s memory: 10864 kB returned value: 0
Found repeated number


