Advertisement
Guest User

Untitled

a guest
Dec 1st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (def input
  2.   [53247
  3.    140268
  4.    139961
  5.    87816
  6.    102986
  7.    122415
  8.    140484
  9.    56099
  10.    52832
  11.    56999
  12.    122823
  13.    130608
  14.    83149
  15.    144224
  16.    104559
  17.    108523
  18.    126571
  19.    137284
  20.    83197
  21.    109996
  22.    56795
  23.    73112
  24.    50043
  25.    130097
  26.    113563
  27.    91200
  28.    130589
  29.    83725
  30.    108625
  31.    131977
  32.    95213
  33.    149800
  34.    70756
  35.    86240
  36.    134854
  37.    148919
  38.    114460
  39.    95062
  40.    122989
  41.    57274
  42.    112074
  43.    139530
  44.    131217
  45.    55652
  46.    125522
  47.    77304
  48.    144873
  49.    86811
  50.    107768
  51.    70704
  52.    146300
  53.    87256
  54.    118752
  55.    52585
  56.    126269
  57.    124559
  58.    52592
  59.    112097
  60.    123090
  61.    101778
  62.    136424
  63.    74547
  64.    119337
  65.    143570
  66.    113426
  67.    146458
  68.    88135
  69.    100236
  70.    148224
  71.    98718
  72.    135181
  73.    56608
  74.    109671
  75.    144027
  76.    135192
  77.    111620
  78.    69411
  79.    107957
  80.    88448
  81.    64972
  82.    63010
  83.    100625
  84.    96144
  85.    61998
  86.    59813
  87.    124503
  88.    64306
  89.    73119
  90.    77094
  91.    136295
  92.    132224
  93.    125713
  94.    110137
  95.    51478
  96.    90272
  97.    133506
  98.    72218
  99.    100082
  100.    106377
  101.    140290])
  102.  
  103. (defn required-fuel [mass]
  104.   (- (int (Math/floor (/ mass 3))) 2))
  105.  
  106. (->> input
  107.      (map required-fuel)
  108.      (reduce + 0)) ;; => 3452245
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement