SHARE
TWEET

Untitled

a guest Jun 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. threes = []
  2. # Logic
  3. if n % 3 == 0:
  4.     for i in range(int(n / 3)):
  5.         threes.append([mins[i], mins[i+1], mins[i+2]])
  6. elif n % 3 == 1:
  7.     for i in range(int(n / 3)):
  8.         threes.append([mins[i], mins[i+1], mins[i+2]])
  9.     threes.append([mins[-1]])
  10. else:
  11.     for i in range(int(n / 3)):
  12.         threes.append([mins[i], mins[i + 1], mins[i + 2]])
  13.     threes.append([mins[-1], mins[-2]])
  14. # Finding Min
  15. for i in range(len(threes)):
  16.     tot += min(threes[i])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top