We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defmodifySequence(arr):c=0# Write your code hereforv,iinenumerate(arr):ifvinrange(len(arr)-1):ifarr[v]>=arr[v+1]:c=c+1x=random.randint(arr[v],arr[v+2])k=1ifx==arr[v+1]else0arr[v+1]=xifk==1:c=c+1returnc
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Modify The Sequence
You are viewing a single comment's thread. Return to all comments →