Asif_Anwar

q-1

Nov 19th, 2021
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. def checkInterval(cir_arr, size, start, interval):
  2.     l = len(cir_arr)
  3.     temp = 0
  4.     start2 = start + interval - 1
  5.     while True:
  6.         if temp >= l:
  7.             return
  8.         temp+=interval
  9.         start2 %= l
  10.         if cin_arr[start2] % 2 == 0:
  11.             temp2 = 0
  12.             next_odd = 0
  13.             indx = start2
  14.             while True:
  15.                 if temp2==l:
  16.                     break
  17.                 if cin_arr[indx % l] % 2 == 1:
  18.                     next_odd = cin_arr[indx % l]
  19.                 indx+=1
  20.             cin_arr[start2] = next_odd
  21.         start2 += interval
  22.        
  23.        
  24.        
  25.        
  26.        
  27.        
Advertisement
Add Comment
Please, Sign In to add comment