[python] Goodies

Viewer

  1. minDif = -1
  2. selectionStart = -1
  3.  
  4. for i in range(0, n-m+1):
  5.     difference = a[i+m] - a[i]
  6.     if difference < minDif:
  7.         minDif = difference
  8.         selectionStart = i
  9.         
  10. # print the items starting from selectionStart in the sorted List

Editor

You can edit this paste and save as new:


File Description
  • Goodies
  • Paste Code
  • 28 Feb-2021
  • 256 Bytes
You can Share it: