Cody

Problem 2153. Replace pattern 0 1 0 and 1 0 1

Created by Anette in Indexing III

Find and replace a pattern in a row of zeroes and ones.

  • Find 1 0 1 and replace it with 1 1 1
  • Find 0 1 0 and replace it with 0 0 0

Example:

 Input : [ 1 1 1 0 1 1 0 0 0 1 0 0 0 ]
 Output: [ 1 1 1 1 1 1 0 0 0 0 0 0 0 ]

Solution Stats

55.56% Correct | 44.44% Incorrect
Last solution submitted on Jul 22, 2019

Problem Comments

Solution Comments

Recent Solvers61

Suggested Problems

More from this Author1