code: def ctc_label(p):
          
          ret = []
          p1 = [0] + p
          for i, _ in enumerate(p):
              c1 = p1[i]
              c2 = p1[i+1]
              if c2 in (0, c1):
                  continue
              ret.append(c2)
          return ret
docs: Iterates through p, identifying non-zero and non-repeating values, and returns them in a list Parameters
          ----------
          p: list of int
  
          Returns
          -------
          list of int