Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Remove adjacent number

def remove_adjacent(nums):
  i = 1
  while i < len(nums):    
    if nums[i] == nums[i-1]:
      nums.pop(i)
      i -= 1  
    i += 1
  return nums
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Remove #adjacent #number
ADD COMMENT
Topic
Name
5+4 =