fallshare
: fallshare
fallshare |
Advent of Code 2021
I once again decided to go with python.
Run the solution with python solution.py
print("hello world")
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
file1 = open('input.txt', 'r')
Lines = file1.readlines()
elves = []
elve = []
for line in Lines:
if line == "\n":
elves.append(elve)
elve = []
else:
elve.append(int(line))
# don't forget to add the last elve
elves.append(elve)
maxCal = 0
for elve in elves:
cal = sum(elve)
if cal > maxCal:
maxCal = cal
print(f"Star 1: The biggest amount of calories is: {maxCal}")
calories = []
for elve in elves:
calories.append(sum(elve))
calories.sort()
highestCalories = calories[-3:]
print(f"Star 2: The sum of the three highest calorie package is: {sum(highestCalories)}")
4601
1583
2995
5319
3352
1722
4331
5840
3339
5341
3415
1297
1610
2703
5928
1266
6405
4354
2815
1621
3545
1733
2162
1155
3674
4055
4262
2115
25873
16103
17042
6479
1521
6902
6331
6146
1591
2063
2149
1463
1865
2598
6893
3617
1431
8935
8134
8885
8698
8884
7982
3617
7079
34031
8383
3697
1199
3703
1322
5679
1627
5910
1092
6445
2371
3672
2281
2710
5111
17480
58355
3711
2406
2101
1406
5376
2149
4608
6768
6322
3792
4249
2342
2014
6197
6908
8484
3901
3001
7880
5165
2536
3964
4229
4898
4544
3535
6329
1573
4988
1424
57606
16325
6038
11538
13026
12734
6077
4696
3914
2375
1188
1247
1594
1843
5297
6053
1114
3179
5968
1430
4268
2514
6684
2321
3946
1746
7583
10379
3696
10110
5834
5944
9336
9638
3373
4279
9942
7208
7801
3771
8183
1824
8217
1545
3041
7369
5980
8368
6180
3100
4801
4430
6758
3023
3394
2545
4992
3347
5830
3764
3237
2431
3406
1408
5601
6548
4625
32334
1112
5471
10983
8298
4342
4221
7807
5733
2012
5928
3503
2785
4867
1515
4819
3569
3353
5997
4921
5498
3234
5588
11040
5547
12070
2168
7603
7245
4966
13027
12518
15381
3251
14935
15858
29295
2476
4289
10350
3953
10089
6953
5555
3007
61732
5567
4895
6095
4880
2945
6022
2129
5010
4100
3554
3410
1820
9902
33605
15331
15615
5062
15073
5940
2252
1233
2582
3624
2754
2304
3189
4060
3862
5164
1487
2776
1807
3385
6798
2385
3755
10299
11500
6478
1911
1469
9309
1785
17145
3363
3210
3285
4491
5992
2927
4098
2133
3191
2810
4694
31006
1582
4356
6146
2051
6503
9487
9244
4808
7761
7108
1771
6062
7135
5575
3278
1221
2547
7266
5444
7395
10634
1196
1361
2810
3106
8654
9455
3778
4219
8882
9387
5128
7114
1441
6146
4752
2388
6420
7350
1624
6050
5469
6751
5570
4674
2074
3476
4064
9446
2889
4871
6298
2970
8588
3482
8492
2226
4951
6733
5463
3183
4807
4806
6974
10251
4637
9558
5153
4665
6860
6949
1524
4201
4397
2278
4909
1353
2074
1920
7439
1040
4135
1411
5536
8004
3090
1036
6613
6353
6810
3932
4743
1615
3201
3791
6357
2511
3440
2290
4741
2844
3121
3641
3497
4549
5142
4438
2945
4576
4871
4795
6007
4884
1031
2111
4388
4705
5725
3425
45444
6688
9460
2727
6989
6789
12460
7310
5910
7822
7627
7600
4793
3152
5747
5197
8006
23983
33879
1020
4783
5117
3628
3065
6131
5543
1576
1159
3721
3182
1409
2738
5084
42750
8509
4370
1042
5664
59445
1589
5133
6413
6578
3301
8256
7749
4321
8190
5025
27739
18609
5447
4022
4069
1437
2811
6929
2754
1108
7390
3995
3480
3225
4240
6959
3289
8063
4751
4896
4611
6256
1105
1334
7598
27831
1821
5333
7853
6574
7985
3972
2306
1875
1857
6386
12780
2513
22939
9625
3785
8050
7432
11772
10914
1387
3439
4644
3880
1878
3911
5329
1480
5779
2083
3886
5525
3930
4813
2570
15763
2839
14258
1460
6193
3397
3222
3262
3735
2406
5588
2068
2862
3271
1401
3957
5690
4632
15070
5164
8902
9580
4271
4494
5665
7242
7687
7031
6135
2670
3315
6146
8085
2625
24285
4414
5985
2681
7036
6486
2501
4408
8582
5150
4295
1082
1497
5638
4643
1413
5969
1515
4016
4856
3287
3122
2948
3711
5031
4692
6445
2261
2132
3517
2461
2767
2071
2176
6357
1304
6034
1346
1318
4719
2054
1433
6514
3729
4329
1026
1502
2611
1363
6379
3617
1885
7519
2849
5167
3136
4819
8018
4110
2666
6098
4943
6575
1624
6004
4178
7453
5979
6736
3883
7109
1271
1175
9494
12633
11576
3547
4653
6777
4497
2246
4666
4675
4440
7227
3808
2425
6014
7305
2538
6155
4321
6239
6279
1445
5592
4920
5435
1392
4122
10513
6359
1574
7222
9013
2150
8377
8884
4108
5427
1605
6907
7861
10554
1210
1346
5296
4419
9147
1858
2956
2070
10271
5810
2632
9429
3941
4306
4972
6216
6345
3971
3920
6295
3552
1399
5425
5218
4512
3376
4460
4107
4484
5148
5456
7902
2185
3439
7199
9514
11030
12096
2886
1561
14057
7480
12186
8600
4085
11755
4564
1697
6345
10176
2538
10138
8328
10621
13322
13907
5450
3403
5776
5967
3873
2761
5992
2251
2278
4673
3442
2720
2556
4848
5967
2806
8228
9047
10630
4367
4917
4084
7893
2842
18343
1497
19962
3985
10986
1431
1569
8053
8987
6474
5733
2237
6183
1642
1005
4389
1889
2385
2470
6338
2200
3399
3659
4092
6579
5872
4229
1081
2254
1229
5218
4267
6906
2818
1084
3655
2294
1882
5005
3805
2088
6809
4982
1935
6789
1961
1842
5988
2859
3965
2313
1021
5090
1309
5110
3142
4102
2919
6010
3079
5786
3701
2659
5728
4251
1899
4119
8941
6677
2161
2119
2772
3122
7821
6113
5150
3486
2072
4089
2820
3161
7589
1787
5988
10582
8240
1934
1504
9070
1186
7766
1066
6700
6181
3238
1940
1229
3688
1375
5873
2328
6384
7446
7246
5542
6771
1964
4532
3011
2300
1451
6726
4595
2926
5237
5020
6129
15008
4409
6769
2211
11825
8947
17411
2893
8460
11664
2304
6865
2132
9174
15540
16925
12015
7621
1439
11886
3028
4604
1057
5342
4723
7773
3373
7488
8028
3246
6355
1939
2921
4447
3472
5175
5909
5936
5263
3993
1589
3906
4865
3156
2010
10089
5964
7650
4692
1537
3281
3162
1064
4567
3910
2229
3566
15533
17311
11818
6179
4583
4577
3573
1379
3761
1048
4799
4275
3515
5637
5435
3801
5933
1926
11841
16030
3213
4307
7300
1237
5513
6799
2402
2554
67023
1573
6798
3002
7536
2373
5994
10122
1149
1836
7129
6621
7432
2468
4028
6560
5127
3781
7035
5845
13729
10212
10942
10087
10080
6493
6850
5969
3370
5400
6433
4762
5702
6193
1836
1507
2637
3051
1394
5465
10565
4923
1671
9789
9150
6466
8013
31283
2001
6032
6765
3896
7593
3175
3447
1718
6062
7630
6302
4448
1014
4756
4696
4069
5663
2181
6153
9228
1871
11739
10894
7435
6290
3249
9358
9196
8951
5023
4910
9686
3823
4247
7159
4630
3352
7700
7752
3343
4577
2448
10326
10002
28943
2592
4430
4077
2126
4628
6466
5919
7019
2667
2573
7038
3153
2837
12151
9774
1574
3046
13079
6949
5306
7432
4274
6835
7057
5695
4727
5581
6516
3903
3138
4083
4247
1806
2753
3612
3509
5498
2160
5814
1502
5760
4663
1354
1592
59040
3738
7624
4539
8649
9418
5495
1178
8389
4458
5283
2572
3530
6228
4711
2621
2131
6363
5611
3236
2314
2547
1905
3744
1413
2997
2214
4673
4481
5827
3752
5489
5301
7568
6869
2928
2900
11668
7579
2324
7245
14362
1191
5622
2764
3241
3690
3627
2637
4043
3012
2773
4276
1127
3649
5327
6535
4821
5531
3037
4700
6287
6476
2266
7550
3054
5023
1296
4394
5649
1822
6609
7038
5836
6571
6918
9473
5377
8449
4839
3118
7861
8784
3880
5133
6131
2114
5196
10405
1040
5003
5888
6058
6910
3155
3278
1159
3863
4565
1181
2716
6431
3014
7633
4984
1297
4524
5183
3717
12038
5908
7784
11211
7635
2060
5502
9179
6537
6895
3455
4799
5557
3497
4467
1694
5227
1663
2377
3538
4529
9371
2421
9789
7373
6459
6405
7775
8218
2077
8589
3417
7811
10255
4325
7168
5963
2806
3512
2369
5721
3852
3022
3764
6152
1158
6460
4694
1909
2655
7789
3030
3621
6269
3149
6405
2288
3512
5674
1301
6120
2629
6348
7105
3459
6678
5903
4519
3074
2086
3927
2924
12290
1873
5613
3098
8641
24464
37206
7180
13271
4832
10691
9084
4915
1440
1841
1476
7124
1692
7480
4583
1896
3475
5424
6864
3187
4680
5159
4314
3148
1060
7290
2080
8308
2412
16405
15203
5606
9411
13201
6242
11906
15782
12558
5319
7968
6732
9702
7203
3571
7241
8764
3466
6032
6608
6898
7189
2749
6184
7590
4976
4289
8553
8238
5844
8314
3264
2924
2586
1234
3126
5269
6147
6029
2384
6440
6161
1708
2928
2336
24565
31964
11118
10621
1430
3312
1135
6740
9456
16874
4385
8675
4237
1537
4313
5552
2195
3530
2433
3056
3693
1151
4297
2017
4917
3823
3388
1580
5795
2642
3822
1824
2366
3800
2020
4065
2758
2677
3951
5175
4433
1199
3212
4183
2822
6355
4427
6384
2931
4892
3148
5802
3885
4892
5233
4269
4286
3711
5430
6115
5561
5066
2796
3886
1960
6083
4657
11662
12901
6891
3897
1086
4333
1477
1046
5670
3996
1909
3544
5143
1387
6319
3084
3136
6084
36111
14790
6552
8491
6636
9718
15736
1619
9531
7507
7311
5991
6901
12139
10580
10956
7878
9100
11884
2906
10388
7767
4040
5872
1060
2299
1008
3597
2749
5025
1550
5364
7108
8661
8894
9240
10008
4243
46695
4195
2850
2978
4995
2944
5773
3669
3662
4471
6343
4258
1252
6408
5995
9482
11898
9022
8167
9232
2647
1990
2948
5314
2341
3828
2513
2091
4173
9640
2690
8774
11619
11201
2429
7216
3433
5914
5223
4879
1349
4692
2906
3761
4416
4813
2751
4474
2057
1675
9803
8986
3617
2175
1412
8370
7671
6448
6759
1857
25790
14495
1872
6441
4585
4053
4142
5844
2089
3387
2660
5890
6499
3769
2710
23432
16915
1351
2656
6557
1149
5054
1681
6871
2643
3158
1617
4087
6498
4993
5494
10055
2730
5800
2923
8037
3448
1527
5803
18165
21951
4766
3809
4678
3184
9687
7825
7222
6638
2016
1801
1717
4955
6088
1848
4033
7023
3551
5970
1415
7027
7411
25450
11523
22548
1566
4742
3947
2708
2019
3479
4735
6002
7042
1828
7071
1535
14218
5232
10228
3340
7975
8837
3510
10363
11854
2821
7627
10186
1102
3749
1436
1561
3098
3849
3726
2041
1100
1532
5473
4643
5922
4739
1216
4408
7369
1369
4742
7109
4368
3468
2777
3296
6999
5777
5019
3750
12190
15694
12690
14834
15532
1955
8702
1209
3012
3074
8390
6779
6117
2544
3900
6374
4126
5772
7149
3949
2371
2374
2469
7839
7898
2871
5808
1108
9610
4374
10275
2595
9413
8906
6402
1551
6560
8632
5064
2152
3443
4229
13104
24831
17968
4648
5332
4866
1048
4089
4710
1406
2544
5319
4685
4622
6080
5899
3266
5694
12879
4015
16066
1600
11186
31873
3871
6382
5076
3606
4283
7913
11124
9959
14807
17825
5880
3914
14183
8104
8322
10254
3957
1410
9402
2012
1130
4640
5738
3860
1510
3067
5021
5321
2820
1269
3433
5216
5585
1344
5975
9879
4969
9796
1404
6772
3240
1954
12512
13741
6425
13234
10597
12414
2031
2255
3306
1831
1601
1959
4452
5054
4967
5392
4040
4989
4385
5838
5043
3165
10185
10580
1626
5436
9644
10842
5139
8090
1045
5867
5987
8488
2409
1045
2843
3543
3224
2855
3318
4192
4600
5773
4074
4705
4716
1798
5274
2443
6325
7878
4932
7543
8073
2113
5481
8138
2151
1296
6007
2506
2346
3631
1526
4875
3099
5253
6281
2057
3209
2622
2930
4926
2901
4561
2361
4474
8508
6515
5024
2201
4402
6922
4219
24714
17196
38164
1900
5727
3935
5498
6165
4621
3347
4387
5982
4213
1742
1302
2452
3923
9558
7131
15662
9101
13730
6474
2222
6539
3747
5995
5573
6288
4684
5121
2226
1722
1117
1020
3565
3489
18395
20407
57158
19992
3636
4392
4584
5421
3159
5817
2303
1013
1758
1802
4630
4261
1524
1639
4652
1967
4765
4946
3023
2732
2749
5258
5935
6428
3053
6328
2389
5681
5450
1993
2824
3596
2658
8545
6577
3024
4001
1780
7902
6187
1349
6028
3307
1964
5116
2308
6108
4286
1689
3324
3728
4946
4267
3801
3806
14183
29320
32460
25012
3317
5545
7302
4936
7934
6094
7971
2497
8130
3752
4195
2147
7770
4214
4737
7962
5942
4478
3816
7508
6693
26013
8614
19828
1144
2361
4371
4246
3442
1693
5137
5806
2434
1413
3135
4028
4757
6005
2351
4927
3004
3384
1545
2172
3407
4120
3954
1806
2342
5847
5228
1005
11490
7855
9775
10577
3232
5211
8316
2984
13490
15716
7433
11288
14551
10056
14839
7241
4573
2731
3358
4850
6352
5419
1021
6611
6489
3794
6089
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
A Y
B X
C Z
file1 = open('input.txt', 'r')
Lines = file1.readlines()
# a = rock
# b = paper
# c = Scissors
# x = rock = 1
# y = paper = 2
# z = Scissors = 3
def getRoundResult(opponent, me):
# draw
if (opponent == me):
return 3 + getHandValue(me)
# winning against rock
if ((opponent == "rock") and (me == "paper")):
return 6 + getHandValue(me)
# loosing against rock
if ((opponent == "rock") and (me == "scissors")):
return getHandValue(me)
# winning against paper
if ((opponent == "paper") and (me == "scissors")):
return 6 + getHandValue(me)
# loosing against paper
if ((opponent == "paper") and (me == "rock")):
return getHandValue(me)
# winning against scissors
if ((opponent == "scissors") and (me == "rock")):
return 6 + getHandValue(me)
# loosing against scissors
if ((opponent == "scissors") and (me == "paper")):
return getHandValue(me)
def getProperHandName(hand):
match hand:
case "A":
return "rock"
case "X":
return "rock"
case "B":
return "paper"
case "Y":
return "paper"
case "C":
return "scissors"
case "Z":
return "scissors"
def getHandValue(hand):
match hand:
case "rock":
return 1
case "paper":
return 2
case "scissors":
return 3
sum = 0
for line in Lines:
opponent, me = line.strip().split(' ')
sum += getRoundResult(getProperHandName(opponent), getProperHandName(me))
print(f"Star 1: Total sum is {sum}")
def getRequiredHand(opponent, desiredOutcome):
# loose
if desiredOutcome == "X":
if( opponent == "A"):
return "scissors"
if(opponent == "B"):
return "rock"
if( opponent == "C"):
return "paper"
# draw
if desiredOutcome == "Y":
return getProperHandName(opponent)
# win
if desiredOutcome == "Z":
if( opponent == "A"):
return "paper"
if(opponent == "B"):
return "scissors"
if( opponent == "C"):
return "rock"
sum = 0
for line in Lines:
opponent, me = line.strip().split(' ')
sum += getRoundResult(getProperHandName(opponent), getRequiredHand(opponent, me))
print(f"Star 2: Total sum is {sum}")
B Y
A Z
A Z
C Z
B Y
B Y
B X
B Z
C Z
B X
B Y
A Z
B Y
B Z
B Y
C Z
B Z
B Y
B Z
C Y
B Y
A Z
B Y
B Y
B Y
C Y
A Z
B Y
B X
A Z
B X
A Z
A Z
B Y
B Y
B X
A Z
B Y
B Z
C X
C X
B Y
B Y
B X
B X
C X
B X
A Z
B Y
B Y
C X
A Z
B Y
B Z
B X
B X
A Z
A X
B Y
B Y
B Z
C Z
B Z
B Z
B Z
A Z
A Z
B X
B X
B Y
B X
B X
C Z
C Z
A Z
A Y
A Z
B Z
A Z
B Y
C X
B X
C X
B Z
B Z
C Z
B Z
B X
C X
A Z
C X
B Z
A Y
C Z
B Y
C Y
B X
A X
B Y
B X
B X
B Z
B Y
A Z
B Z
B Y
B Y
A X
A Z
B X
B X
B X
B X
B Z
B Z
B Y
C X
A Z
A Z
B Y
B Z
B Y
A Z
B Z
A Z
A Z
C X
B Z
A Z
A Z
B Y
B Z
A Z
B Y
B Y
A Z
B Y
C X
B Z
B Y
B X
C X
B X
B X
B X
A Z
A Z
C Y
A Z
B Y
A Z
C X
B Z
B Z
C X
B Y
C X
B X
B X
C X
A Z
B Y
C X
B X
B Y
A Z
B Y
B Y
C X
B Y
C X
A Z
A Z
A Z
B Y
B Y
A X
A Z
A Z
B Y
C X
C Y
B Y
C X
A Z
B X
A Z
A Z
C X
B Y
A Z
B Y
C X
A Z
B X
B Y
A Z
B Y
B X
B X
C X
B Y
C Y
A Z
B Y
B Y
C Y
B Y
C Y
C X
A Y
A Y
B Z
B Y
A Z
B Z
B X
B X
B Y
A Z
B Y
B X
B Y
B Y
C Z
B Y
B Y
A Z
A Z
B Z
A Y
C X
B Y
B Y
B Z
B Z
B Y
C X
B Y
B X
B Z
B Y
B X
B Y
C Z
B Y
B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Y
B X
B Y
B Z
C Z
A Y
A Z
B X
B X
A Z
C Y
B Y
A X
A Z
B X
B Y
B X
A Z
C X
B Y
B Y
C X
A X
B Y
A Z
A Z
B Y
B Z
B Y
B Y
B Y
B X
B Y
B X
B X
B X
B Y
A Z
C X
A Z
A Z
A X
A Z
B X
B Z
B Y
A Z
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
vJrwpWtwJgWrhcsFMMfFFhFp
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
PmmdzqPrVvPwwTWBwg
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
ttgJtRGJQctTZtZT
CrZsJsPPZsGzwwsLwLmpwMDw
file1 = open('input.txt', 'r')
Lines = file1.readlines()
def getItemValue(priority):
if ord(priority) > 97:
return ord(priority) - 96
else:
return ord(priority) - 38
priority_sum = 0
for line in Lines:
characters = list(line.strip())
middle = (int(len(characters) / 2))
elf_one = characters[0 : middle ]
elf_two = characters[middle : len(characters) ]
item = list(set(elf_one) & set(elf_two)).pop()
priority_sum += getItemValue(item)
print(f"Star 1: Item priority sum is {priority_sum}")
line_cnt = 0
groups = []
group = []
for line in Lines:
group.append(list(line.strip()))
line_cnt += 1
if line_cnt == 3:
groups.append(group)
group = []
line_cnt = 0
priority_sum = 0
for group in groups:
item = list(set(group[0]) & set(group[1]) & set(group[2])).pop()
priority_sum += getItemValue(item)
print(f"Star 2: Item priority sum is {priority_sum}")
GbccTtTSGGbgrcWBGGrdgTnVQnCmNpCJlNnNPVfClcnN
vMzvZhzhwDLVmQnClwwNQp
FRsZFzjQFsqRzRRjDZbdtTgdHBBWGrdBdHHs
HCLTmbCLgzNBNPSSlT
JJGMWRJMrrdwWWGjGWMLRGLjBzNQsBzPPfflzDPBsBffDrQz
pwJdLMjdMddWjLtwZWMMwGtHhnvnCnhvqVFFZnvbgbqVCZ
tvMCDCSVVvDDBQFRbqWMMsWgFWgc
BLLPTpBmfLPrHLLfLsbhRqbzRRcRHgqssR
dfdNL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zjGRzm
HZvvDLLWqbBBMRMRNjVhHRmn
vZDCvqqgBDZZjbZDrWqBvpdpFpcdpCJcPTSJJtptpP
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
2-4,6-8
2-3,4-5
5-7,7-9
2-8,3-7
6-6,4-6
2-6,4-8
file1 = open('input.txt', 'r')
Lines = file1.readlines()
overlap_cnt = 0
for line in Lines:
one, two = line.strip().split(",")
elve_one = one.split("-")
elve_one = list(map(int, elve_one))
elve_two = two.split("-")
elve_two = list(map(int, elve_two))
if (((elve_one[0] >= elve_two[0]) and (elve_one[1] <= elve_two[1])) or
((elve_two[0] >= elve_one[0]) and (elve_two[1] <= elve_one[1]))):
overlap_cnt += 1
print(f"Star 1: {overlap_cnt} pairs where one is full in the other")
overlap_cnt = 0
for line in Lines:
one, two = line.strip().split(",")
elve_one = one.split("-")
elve_one = list(map(int, elve_one))
elve_two = two.split("-")
elve_two = list(map(int, elve_two))
if ( ((elve_one[0] >= elve_two[0]) and (elve_one[0] <= elve_two[1])) or
((elve_one[1] >= elve_two[0]) and (elve_one[1] <= elve_two[1])) or
((elve_two[0] >= elve_one[0]) and (elve_two[0] <= elve_one[1])) or
((elve_two[1] >= elve_one[0]) and (elve_two[1] <= elve_one[1]))
):
overlap_cnt += 1
print(f"Star 2: {overlap_cnt} pairs where one is full in the other")
37-87,36-87
3-98,3-84
33-73,33-33
3-65,1-3
59-72,41-59
15-82,29-84
9-98,97-99
32-32,31-77
85-86,85-93
7-26,26-26
21-78,21-22
22-70,33-99
8-8,8-52
39-57,39-57
29-60,28-59
2-76,2-76
3-96,1-2
57-59,29-62
34-77,34-81
22-70,26-70
24-25,24-24
40-43,39-61
23-40,23-39
92-93,41-94
84-84,9-84
3-77,1-6
35-35,1-99
17-32,18-63
67-98,68-97
67-91,36-90
51-97,96-98
22-91,3-91
17-17,16-30
4-90,8-91
8-39,8-40
11-93,12-94
45-57,4-56
37-98,38-38
44-45,24-44
28-60,53-60
37-74,17-38
40-63,40-62
8-94,11-95
78-78,54-78
43-57,43-53
63-65,8-64
8-83,30-84
39-51,48-52
32-59,32-66
11-89,11-88
38-78,39-98
14-61,15-61
4-97,9-97
63-77,62-95
4-39,2-68
13-97,84-98
1-96,1-97
1-1,1-94
49-95,46-92
2-40,2-39
34-77,35-35
59-59,58-61
14-14,13-92
37-60,37-61
1-94,2-2
37-78,23-99
62-92,61-92
85-85,45-85
27-89,57-87
34-81,81-81
13-69,8-68
2-99,2-2
14-95,14-94
78-87,87-87
66-91,36-92
45-46,45-47
56-60,56-90
44-58,44-57
6-52,4-52
2-97,6-98
18-91,92-92
16-81,80-81
21-39,21-21
10-58,10-59
65-91,64-91
27-77,77-77
2-80,79-79
17-85,62-84
1-15,14-84
6-95,95-95
27-93,28-92
25-70,24-36
30-31,30-68
2-98,2-97
7-94,85-97
27-68,24-69
2-70,2-71
47-90,6-89
76-92,71-90
83-88,83-94
70-76,73-77
65-68,23-92
65-70,69-89
29-55,6-29
26-79,21-21
6-65,7-7
2-43,2-3
21-37,21-60
4-73,2-93
4-95,4-89
28-60,40-61
2-80,67-93
4-92,5-5
5-99,5-97
3-24,6-99
58-58,58-63
8-67,7-82
26-26,25-26
55-59,46-60
58-78,22-77
15-79,15-78
13-54,12-46
6-25,6-26
38-85,37-85
44-98,11-98
93-93,37-93
9-16,16-19
27-69,27-28
34-92,92-96
11-19,11-26
12-77,11-77
30-30,7-30
71-92,71-92
2-92,1-93
78-96,57-95
1-60,59-61
33-69,27-33
5-95,1-94
37-87,58-87
11-11,10-99
87-87,86-95
67-81,82-82
12-94,91-93
9-72,19-73
8-46,25-41
16-68,15-68
31-47,23-39
73-90,80-91
22-94,22-22
77-92,6-91
30-84,30-84
3-79,6-72
81-85,81-99
54-93,54-92
6-97,3-97
24-68,23-69
49-81,50-80
43-88,19-42
15-16,15-74
6-84,83-83
3-89,10-16
16-31,15-32
8-14,7-94
3-17,3-17
97-99,32-98
18-94,17-17
76-96,20-95
36-85,26-84
7-78,25-78
41-55,41-42
5-47,4-35
3-7,3-55
20-94,9-34
14-21,15-55
27-71,32-72
14-21,19-21
44-46,13-45
37-95,36-95
5-89,5-88
85-85,9-85
24-88,25-95
30-87,30-68
54-87,87-87
9-47,9-47
33-77,27-49
58-58,11-60
26-26,28-92
79-89,10-80
5-63,62-63
8-9,9-47
94-94,89-94
3-59,4-4
48-93,48-83
29-57,29-57
20-91,20-92
30-88,84-89
27-74,1-90
53-69,22-68
36-45,36-46
16-82,16-81
38-57,39-73
14-68,41-68
78-80,63-78
3-23,1-24
1-96,46-67
68-68,64-70
5-99,6-99
6-98,8-94
12-91,5-93
11-95,11-96
66-67,65-66
9-95,9-30
56-93,32-94
14-73,15-72
34-34,34-84
7-20,5-8
44-83,64-84
24-42,7-42
25-25,22-26
34-35,35-76
45-94,33-69
1-4,4-78
51-84,50-92
2-3,3-3
61-96,74-96
1-94,21-99
22-92,64-98
33-33,32-34
8-80,13-79
41-45,44-66
6-17,3-17
15-20,16-17
10-18,10-19
28-67,27-56
41-92,23-92
8-97,21-98
35-90,35-89
6-79,7-80
74-84,16-73
9-87,4-95
10-87,66-91
55-77,7-99
6-76,15-76
66-68,17-67
5-83,4-84
32-63,64-97
77-99,54-83
59-62,63-80
1-98,1-99
90-98,88-98
2-88,88-95
13-92,24-87
61-63,6-62
9-86,8-87
21-45,2-45
27-71,28-71
2-2,1-97
58-91,7-90
18-64,39-58
35-43,15-36
37-87,36-44
4-90,89-89
65-92,66-91
14-14,13-38
9-86,92-97
8-93,12-92
34-35,35-35
24-49,37-49
45-93,45-67
13-97,2-97
20-97,20-29
24-37,24-38
41-75,47-76
3-3,3-61
26-35,1-26
80-94,82-94
82-93,83-83
1-97,2-26
63-89,15-99
2-31,3-87
18-45,17-20
87-97,2-87
28-74,54-77
93-95,2-94
11-71,39-40
12-85,60-85
85-85,4-86
5-70,14-71
15-94,10-28
93-98,96-99
38-66,39-67
5-98,98-98
23-54,23-92
18-47,18-76
5-25,12-26
84-90,80-85
17-99,17-98
8-96,2-96
43-88,43-62
78-89,60-89
76-93,93-93
13-24,13-79
19-27,9-26
19-88,19-87
8-30,9-63
33-66,67-97
35-78,36-79
67-82,66-94
3-11,3-69
58-75,74-76
32-96,2-96
18-71,19-19
24-35,24-36
16-80,17-80
48-84,49-49
66-87,3-66
14-14,2-16
12-35,11-12
41-49,40-48
7-25,7-7
52-52,51-68
3-57,2-4
11-42,6-49
19-39,9-19
1-83,5-84
5-87,8-87
7-72,8-71
25-56,24-66
28-54,53-89
42-45,43-46
65-97,66-96
15-86,85-87
74-74,28-74
36-59,36-85
13-86,6-96
10-59,58-60
23-26,6-24
22-95,29-95
32-33,33-33
20-39,20-20
6-93,6-6
3-98,3-3
41-57,41-56
39-54,39-53
45-99,44-44
45-56,28-86
3-65,6-66
4-38,5-73
54-58,2-66
19-73,19-74
8-96,48-96
6-46,6-47
7-89,7-88
21-71,21-72
1-40,39-39
36-75,37-37
1-96,5-95
31-93,31-92
29-39,40-40
95-98,14-95
8-14,9-67
81-97,82-95
59-61,15-60
42-51,34-51
73-83,23-73
63-77,63-63
8-38,37-39
40-54,41-41
13-15,14-71
10-29,11-11
10-43,11-44
38-54,38-48
20-86,18-20
15-98,13-15
22-40,3-97
95-95,3-96
39-98,40-80
10-91,14-90
10-19,9-10
34-40,35-43
91-92,5-92
26-46,26-45
34-90,34-34
30-47,61-64
5-37,5-5
28-29,28-77
76-76,38-77
10-65,2-65
27-95,19-84
77-99,70-95
79-84,49-80
8-46,37-46
4-55,16-69
45-94,34-94
18-18,19-65
44-85,43-83
43-67,20-34
2-98,2-15
79-90,62-91
35-58,36-58
36-47,14-47
4-94,31-95
91-91,88-91
9-31,30-32
63-78,79-79
8-94,4-98
18-32,18-33
76-76,26-76
54-97,12-96
2-91,2-2
76-76,75-98
8-13,8-80
30-51,42-51
1-55,4-54
53-88,6-88
92-94,85-93
41-85,41-86
56-86,55-72
21-97,21-98
6-6,7-10
3-79,3-90
57-67,58-99
42-46,32-41
2-75,5-74
34-35,33-33
10-77,77-77
7-9,7-11
34-92,34-91
4-26,9-93
43-88,70-89
7-36,36-36
6-99,6-6
23-82,22-85
13-89,85-89
63-79,26-63
15-94,14-94
41-94,42-95
5-60,3-72
96-97,96-98
5-95,80-97
18-78,18-77
57-85,56-84
76-90,82-89
56-56,56-92
49-86,77-85
4-33,8-18
17-47,17-46
46-62,24-61
6-93,60-92
18-94,18-98
59-67,65-67
5-99,7-99
8-71,21-37
14-97,70-97
18-91,19-92
29-45,29-88
1-97,1-64
8-54,16-53
98-99,78-97
29-94,26-99
66-76,18-75
15-91,20-76
43-51,43-51
74-76,53-75
91-97,93-96
5-93,5-92
23-65,23-50
5-94,93-98
42-82,41-43
47-76,47-77
14-49,20-29
22-31,30-56
55-71,55-88
39-75,86-99
23-90,21-89
65-65,39-64
17-92,4-91
22-60,22-87
27-27,26-32
18-75,16-74
22-50,22-99
70-90,71-89
63-64,63-77
33-67,67-67
20-39,20-31
5-5,5-79
23-78,74-79
66-86,67-88
2-76,25-75
70-97,11-96
18-37,18-29
38-73,46-72
2-4,4-98
2-47,2-47
14-70,14-71
35-96,6-95
63-64,63-63
5-83,5-83
33-97,2-99
62-72,72-99
26-79,18-80
14-67,46-54
12-74,13-79
3-57,3-59
44-92,45-93
70-73,69-78
5-76,36-41
52-79,52-72
5-82,3-81
85-87,35-86
8-19,18-20
19-36,18-33
72-74,21-73
36-60,35-45
10-75,3-76
77-85,34-77
18-82,17-82
11-46,20-45
74-94,74-84
1-97,4-81
60-89,89-90
22-27,27-56
25-92,25-26
13-75,66-72
35-50,51-51
2-99,1-98
51-51,50-88
41-92,1-92
3-29,4-28
61-95,3-94
45-70,8-71
6-20,2-21
3-91,91-97
7-94,21-95
81-83,80-96
87-89,8-87
8-9,8-12
9-79,8-79
4-46,2-45
9-34,10-33
1-72,2-72
7-65,7-81
24-31,30-45
75-76,9-75
71-76,22-75
43-87,8-87
5-94,4-94
42-71,64-72
45-52,47-48
2-99,3-78
53-75,53-82
23-67,28-67
33-49,31-48
48-96,11-49
33-33,33-71
19-19,18-93
93-95,40-94
34-82,82-97
39-39,39-80
79-81,47-80
2-9,6-21
69-77,10-20
18-92,11-92
20-85,84-84
34-88,89-89
2-95,3-96
43-62,43-44
2-24,23-25
36-36,36-72
19-71,6-19
72-93,11-93
1-96,95-95
24-62,24-61
41-45,42-44
8-69,37-55
3-9,10-29
22-60,19-40
6-6,5-93
46-72,27-72
8-74,8-75
35-89,90-90
30-66,31-31
16-85,20-86
76-78,30-77
64-86,60-86
1-66,6-65
20-36,36-36
27-35,27-34
1-6,2-9
95-98,84-96
79-82,6-80
15-95,95-99
64-94,63-96
17-34,45-87
17-76,5-75
87-87,73-87
33-42,32-43
66-87,66-93
97-98,97-97
90-90,21-90
4-93,93-95
12-74,1-41
98-98,29-99
51-91,51-82
76-77,76-78
6-53,7-54
3-44,12-14
5-23,18-18
20-20,20-99
24-88,24-89
10-23,7-12
15-40,9-62
4-4,3-94
29-45,29-44
71-71,16-71
47-83,47-48
53-75,53-76
57-92,11-66
49-60,12-78
38-99,4-99
8-99,88-99
21-59,41-67
53-91,54-90
5-84,5-8
45-77,45-78
14-92,91-93
41-48,41-47
37-74,38-73
16-29,15-15
43-89,43-90
2-95,94-94
10-74,9-71
25-89,42-90
88-93,88-92
38-49,33-48
31-97,52-97
12-12,12-92
11-98,11-12
43-76,75-77
39-91,40-82
34-73,72-86
4-46,3-94
43-46,42-56
2-90,89-90
93-93,6-92
35-98,36-98
4-22,12-23
2-96,95-97
2-60,4-60
3-3,3-10
92-94,47-93
71-83,41-82
8-82,3-95
73-90,73-89
35-92,36-36
25-68,26-68
32-60,32-61
37-97,5-97
41-81,24-40
37-37,36-88
5-98,1-99
7-34,14-34
13-80,17-79
91-97,5-92
6-7,6-44
19-92,19-93
59-91,91-92
39-60,59-94
70-71,5-70
44-44,1-45
70-85,70-87
15-43,15-27
1-9,9-9
25-27,5-26
58-91,57-91
18-86,13-85
23-69,4-69
10-56,8-10
99-99,5-99
97-97,91-98
12-41,11-45
65-72,66-72
58-70,57-71
1-22,1-17
31-31,1-32
14-58,58-58
15-16,15-21
31-68,30-41
43-45,39-53
21-25,16-27
86-87,87-87
19-93,10-20
39-97,38-98
21-84,22-87
46-79,46-47
28-33,34-79
37-88,37-87
70-72,36-71
1-88,2-87
4-94,4-93
34-76,35-35
54-89,54-87
13-24,8-13
8-8,8-51
3-80,2-28
32-54,33-65
17-25,17-24
1-98,2-95
4-55,3-54
69-72,69-69
55-81,68-82
7-25,6-65
7-91,8-8
66-87,65-86
18-76,18-77
1-86,4-85
96-96,37-96
27-98,26-90
50-50,10-49
1-1,2-76
55-86,56-63
3-47,2-48
4-77,48-51
1-91,3-88
63-77,63-77
8-94,9-94
87-94,40-98
17-34,33-81
20-76,7-19
11-65,64-73
60-94,93-94
39-98,39-99
2-79,68-96
4-4,3-4
60-95,60-97
21-70,20-20
9-93,18-92
29-57,29-29
44-76,45-77
14-78,10-78
51-70,52-56
18-19,19-19
6-66,6-96
7-7,6-34
38-94,16-93
86-87,53-86
75-92,11-92
1-86,23-85
72-94,72-95
46-54,40-55
1-37,1-66
40-54,19-40
9-26,9-27
78-78,20-79
15-83,20-77
7-92,36-68
64-77,38-78
25-84,26-83
14-94,29-93
20-20,19-73
15-94,15-95
2-88,87-87
11-81,4-17
23-99,25-96
14-84,84-84
4-81,27-81
3-92,3-91
21-97,21-97
6-70,6-69
26-78,19-74
24-80,25-93
30-72,55-71
44-67,28-44
64-71,64-73
6-12,9-13
4-4,3-56
20-86,59-87
21-96,20-96
2-2,2-31
9-41,24-41
42-94,94-99
35-68,34-83
1-3,2-96
24-84,25-83
26-27,26-69
1-89,2-88
59-96,59-95
6-69,2-63
4-99,4-98
41-66,41-80
66-66,53-67
44-45,44-67
10-76,76-77
22-69,69-96
5-7,6-72
10-34,11-48
16-58,18-32
15-98,16-16
54-86,54-85
2-21,20-96
53-85,53-86
11-80,68-80
10-10,9-92
6-61,60-62
26-89,25-90
3-97,2-82
16-47,15-46
21-48,21-47
2-10,2-6
18-32,31-90
43-43,44-92
10-88,82-84
19-92,91-91
6-20,5-20
93-95,1-94
29-99,16-86
70-76,60-82
50-90,50-51
65-97,65-81
33-42,15-41
42-67,28-46
82-93,92-94
1-99,2-79
4-98,2-99
19-36,19-37
14-91,54-90
8-9,8-28
15-82,15-89
10-32,30-30
6-53,1-7
33-48,34-48
4-24,5-23
98-98,5-93
41-85,79-83
58-79,57-96
19-63,20-99
19-19,1-19
77-80,75-78
12-34,4-40
16-85,15-89
17-55,37-47
39-77,36-99
4-42,15-42
27-98,27-63
6-81,5-82
67-82,7-92
34-42,35-49
36-91,37-68
34-57,8-57
70-91,69-92
69-87,70-95
30-81,31-80
63-97,1-97
29-96,95-97
57-93,9-92
6-82,5-56
66-67,65-68
1-92,92-97
77-89,88-90
95-97,11-96
15-33,3-20
29-93,24-92
36-37,36-73
5-57,5-5
23-72,12-74
43-95,43-96
2-98,94-99
8-8,7-96
21-65,20-60
21-29,22-87
95-95,4-96
55-55,43-56
48-58,47-60
7-71,3-70
26-66,45-66
2-37,37-77
42-81,43-43
26-30,31-93
77-93,75-91
27-93,39-94
5-22,5-21
68-70,49-69
11-92,56-74
15-79,46-78
4-27,24-26
87-87,15-88
8-14,8-15
47-48,44-60
10-49,11-23
33-93,32-93
69-69,16-69
15-82,39-83
8-91,8-92
78-89,78-93
11-12,11-52
97-99,1-98
22-86,22-87
63-95,94-97
6-50,6-85
18-47,3-77
54-54,53-92
49-71,62-71
12-98,12-98
83-86,3-86
93-98,98-98
52-86,8-86
5-67,6-6
63-98,1-97
4-70,8-71
24-25,23-95
22-50,23-49
73-84,74-76
4-93,78-93
32-32,32-44
67-87,25-76
28-74,20-28
89-89,15-90
23-83,22-82
19-49,19-85
42-43,42-42
38-38,19-38
21-98,20-89
39-65,14-40
4-34,5-5
7-45,44-46
48-99,2-88
42-82,42-42
44-90,44-45
16-71,42-71
10-95,96-97
13-97,2-99
15-50,4-51
28-44,28-28
87-89,1-88
68-84,66-70
71-71,2-72
22-94,22-93
40-40,40-66
97-97,3-97
60-99,56-99
92-99,92-98
14-95,14-96
32-32,32-38
3-98,10-98
12-99,28-97
5-31,5-32
1-87,1-98
7-89,8-90
19-80,73-80
2-93,2-27
91-93,12-92
71-73,3-72
21-81,21-82
1-62,6-62
96-96,10-96
19-88,20-76
12-21,13-21
2-10,9-9
40-95,40-96
8-43,12-76
48-84,85-96
55-82,55-97
6-99,3-6
52-56,48-56
14-63,4-63
11-36,12-79
10-91,9-92
86-98,87-91
19-98,19-97
14-92,14-91
16-80,15-81
5-80,1-80
70-85,19-84
50-78,51-64
15-69,15-15
6-77,7-67
14-56,1-61
9-89,81-89
10-99,9-58
31-38,31-38
62-75,75-75
47-96,46-96
48-64,49-63
10-82,60-89
28-69,69-69
66-68,66-70
31-58,11-57
4-84,2-85
4-94,4-93
3-97,3-99
2-62,1-63
28-93,55-92
63-80,60-81
52-78,22-77
5-98,88-88
28-82,28-81
36-36,35-55
55-90,89-89
9-51,1-51
3-98,1-2
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
import re
import copy
def main():
file = open('input.txt', 'r')
startingStacks, steps = file.read().split("\n\n")
stacks = get_starting_stack(startingStacks)
stacks_star2 = copy.deepcopy(stacks)
steps = get_step_list(steps)
stacks = process_steps_star1(stacks, steps)
star_one(stacks)
stacks = process_steps_star2(stacks_star2, steps)
star_two(stacks)
def star_two(stacks):
print("The solution for star 2 is: ")
for stack in stacks:
print(stack.pop())
def star_one(stacks):
print("The solution for star 1 is: ")
for stack in stacks:
print(stack.pop())
def process_steps_star2(stacks, steps):
for step in steps:
crane = []
for cnt in range(step[0]):
src, dest = step[1] - 1, step[2] - 1
crane.insert(0,stacks[src].pop())
stacks[dest] = stacks[dest] + crane
return stacks
def process_steps_star1(stacks, steps):
for step in steps:
for cnt in range(step[0]):
src, dest = step[1] - 1, step[2] - 1
stacks[dest].append(stacks[src].pop())
return stacks
def get_starting_stack(startingStacks):
startingStacks = startingStacks.splitlines()
lastLine = startingStacks.pop()
maxStackHeight = len(startingStacks)
stackCount = int(lastLine.split().pop())
stacks = []
for column in range(stackCount):
stacks.append([])
offset = 1
x = column * 4 + offset
for row in reversed(range(maxStackHeight)):
symbol = startingStacks[row][x]
if symbol != " ":
stacks[column].append(symbol)
return stacks
def get_step_list(steps):
stepList = []
steps = steps.splitlines()
for step in steps:
result = re.search(r"move (\d*) from (\d*) to (\d*)", step)
instructions = result.groups()
instructions = [int(i) for i in instructions]
stepList.append(instructions)
return stepList
if __name__ == '__main__':
main()
[B] [B] [S]
[M] [P] [L] [B] [J]
[D] [R] [V] [D] [Q] [D]
[T] [R] [Z] [H] [H] [G] [C]
[P] [W] [J] [B] [J] [F] [J] [S]
[N] [S] [Z] [V] [M] [N] [Z] [F] [M]
[W] [Z] [H] [D] [H] [G] [Q] [S] [W]
[B] [L] [Q] [W] [S] [L] [J] [W] [Z]
1 2 3 4 5 6 7 8 9
move 3 from 5 to 2
move 5 from 3 to 1
move 4 from 4 to 9
move 6 from 1 to 4
move 6 from 8 to 7
move 5 from 2 to 7
move 1 from 5 to 4
move 11 from 9 to 7
move 1 from 1 to 9
move 6 from 4 to 6
move 12 from 6 to 7
move 1 from 9 to 2
move 2 from 4 to 6
move 1 from 8 to 9
move 1 from 9 to 4
move 1 from 6 to 1
move 2 from 7 to 5
move 2 from 6 to 7
move 2 from 1 to 6
move 2 from 4 to 7
move 1 from 5 to 4
move 1 from 5 to 6
move 1 from 6 to 1
move 1 from 1 to 3
move 1 from 4 to 1
move 1 from 1 to 4
move 1 from 4 to 5
move 1 from 3 to 9
move 1 from 5 to 1
move 4 from 2 to 1
move 20 from 7 to 8
move 24 from 7 to 3
move 3 from 6 to 4
move 1 from 1 to 9
move 1 from 9 to 3
move 2 from 1 to 2
move 2 from 4 to 1
move 2 from 2 to 1
move 14 from 3 to 6
move 6 from 1 to 6
move 10 from 3 to 2
move 1 from 2 to 3
move 6 from 6 to 5
move 2 from 3 to 4
move 13 from 8 to 4
move 1 from 9 to 7
move 1 from 6 to 3
move 10 from 4 to 2
move 1 from 3 to 6
move 2 from 8 to 7
move 1 from 7 to 2
move 11 from 6 to 8
move 2 from 6 to 1
move 2 from 1 to 3
move 1 from 8 to 6
move 1 from 3 to 9
move 3 from 8 to 2
move 1 from 3 to 6
move 2 from 6 to 4
move 1 from 6 to 5
move 11 from 2 to 9
move 2 from 4 to 6
move 1 from 6 to 1
move 1 from 1 to 5
move 11 from 2 to 7
move 12 from 7 to 5
move 1 from 6 to 2
move 10 from 8 to 7
move 6 from 5 to 3
move 4 from 5 to 4
move 11 from 9 to 7
move 7 from 4 to 9
move 4 from 9 to 6
move 12 from 7 to 3
move 1 from 8 to 9
move 1 from 5 to 1
move 1 from 1 to 2
move 1 from 6 to 9
move 3 from 4 to 1
move 1 from 9 to 7
move 8 from 7 to 2
move 3 from 6 to 1
move 8 from 2 to 3
move 1 from 7 to 4
move 2 from 7 to 2
move 1 from 5 to 2
move 8 from 5 to 1
move 3 from 9 to 6
move 1 from 6 to 2
move 1 from 4 to 5
move 1 from 5 to 4
move 2 from 9 to 3
move 1 from 8 to 6
move 1 from 4 to 5
move 1 from 5 to 1
move 1 from 6 to 8
move 1 from 8 to 1
move 7 from 1 to 5
move 11 from 3 to 7
move 1 from 1 to 9
move 4 from 2 to 1
move 5 from 1 to 3
move 1 from 5 to 9
move 1 from 6 to 3
move 6 from 2 to 1
move 5 from 7 to 3
move 1 from 6 to 8
move 1 from 8 to 4
move 6 from 7 to 9
move 4 from 9 to 8
move 2 from 8 to 9
move 2 from 5 to 8
move 13 from 3 to 7
move 1 from 3 to 8
move 2 from 1 to 9
move 3 from 1 to 5
move 1 from 4 to 1
move 6 from 5 to 9
move 8 from 9 to 8
move 2 from 7 to 3
move 1 from 9 to 7
move 1 from 5 to 2
move 5 from 9 to 8
move 1 from 8 to 7
move 1 from 2 to 9
move 7 from 1 to 2
move 4 from 7 to 5
move 6 from 2 to 3
move 1 from 2 to 1
move 10 from 8 to 9
move 3 from 8 to 9
move 4 from 5 to 1
move 2 from 8 to 6
move 9 from 9 to 8
move 1 from 9 to 6
move 8 from 8 to 4
move 12 from 3 to 5
move 1 from 4 to 2
move 3 from 8 to 1
move 3 from 9 to 7
move 1 from 3 to 2
move 1 from 6 to 9
move 8 from 3 to 8
move 6 from 4 to 5
move 1 from 7 to 6
move 1 from 8 to 1
move 6 from 8 to 7
move 1 from 3 to 6
move 7 from 1 to 5
move 1 from 4 to 9
move 4 from 6 to 5
move 13 from 7 to 5
move 1 from 8 to 2
move 2 from 9 to 3
move 4 from 7 to 2
move 1 from 3 to 8
move 1 from 3 to 4
move 4 from 1 to 2
move 1 from 5 to 7
move 23 from 5 to 6
move 1 from 8 to 6
move 1 from 9 to 4
move 5 from 2 to 6
move 1 from 4 to 9
move 1 from 9 to 3
move 1 from 7 to 8
move 1 from 4 to 3
move 1 from 3 to 7
move 1 from 7 to 5
move 1 from 8 to 7
move 12 from 6 to 1
move 1 from 2 to 5
move 1 from 3 to 1
move 20 from 5 to 2
move 14 from 2 to 4
move 11 from 2 to 6
move 1 from 7 to 8
move 13 from 1 to 8
move 9 from 8 to 4
move 3 from 8 to 6
move 10 from 6 to 8
move 6 from 6 to 4
move 4 from 8 to 5
move 26 from 4 to 2
move 2 from 5 to 2
move 5 from 8 to 1
move 1 from 8 to 3
move 2 from 1 to 3
move 2 from 3 to 7
move 27 from 2 to 7
move 2 from 8 to 1
move 1 from 3 to 7
move 6 from 6 to 2
move 4 from 6 to 1
move 4 from 6 to 4
move 2 from 5 to 4
move 4 from 2 to 1
move 3 from 1 to 8
move 1 from 2 to 8
move 8 from 4 to 3
move 1 from 2 to 8
move 5 from 8 to 6
move 1 from 4 to 2
move 1 from 2 to 1
move 6 from 3 to 1
move 13 from 7 to 1
move 1 from 2 to 8
move 1 from 8 to 2
move 1 from 6 to 2
move 1 from 2 to 8
move 1 from 8 to 2
move 14 from 7 to 1
move 5 from 6 to 3
move 2 from 3 to 1
move 3 from 3 to 2
move 3 from 7 to 4
move 1 from 4 to 9
move 1 from 9 to 7
move 2 from 3 to 6
move 5 from 2 to 7
move 1 from 7 to 6
move 5 from 7 to 6
move 2 from 6 to 7
move 1 from 6 to 8
move 1 from 4 to 7
move 4 from 6 to 9
move 35 from 1 to 8
move 3 from 7 to 2
move 1 from 2 to 5
move 24 from 8 to 3
move 1 from 5 to 8
move 13 from 3 to 6
move 2 from 2 to 6
move 6 from 6 to 4
move 11 from 1 to 6
move 12 from 6 to 1
move 1 from 8 to 1
move 2 from 1 to 3
move 5 from 4 to 1
move 1 from 6 to 4
move 1 from 8 to 3
move 13 from 3 to 9
move 3 from 8 to 2
move 3 from 2 to 7
move 1 from 3 to 6
move 3 from 7 to 8
move 14 from 1 to 3
move 1 from 1 to 9
move 6 from 3 to 8
move 17 from 8 to 6
move 1 from 3 to 7
move 1 from 7 to 8
move 26 from 6 to 7
move 1 from 1 to 9
move 3 from 4 to 1
move 2 from 3 to 8
move 1 from 8 to 4
move 14 from 9 to 7
move 12 from 7 to 3
move 2 from 1 to 4
move 2 from 7 to 8
move 2 from 8 to 3
move 4 from 9 to 8
move 1 from 4 to 7
move 1 from 1 to 3
move 2 from 4 to 2
move 24 from 7 to 6
move 1 from 8 to 1
move 1 from 7 to 2
move 1 from 7 to 9
move 3 from 2 to 9
move 1 from 1 to 6
move 5 from 8 to 2
move 5 from 3 to 4
move 1 from 2 to 5
move 3 from 9 to 8
move 2 from 4 to 9
move 16 from 6 to 3
move 14 from 3 to 8
move 1 from 7 to 9
move 8 from 6 to 9
move 4 from 8 to 5
move 8 from 8 to 3
move 1 from 5 to 8
move 1 from 2 to 4
move 4 from 8 to 7
move 1 from 5 to 6
move 12 from 9 to 5
move 15 from 5 to 8
move 1 from 6 to 1
move 2 from 2 to 6
move 3 from 4 to 2
move 4 from 2 to 7
move 8 from 7 to 3
move 1 from 1 to 4
move 3 from 6 to 9
move 16 from 8 to 3
move 3 from 9 to 4
move 1 from 8 to 9
move 2 from 9 to 4
move 24 from 3 to 8
move 19 from 8 to 7
move 2 from 8 to 7
move 7 from 4 to 5
move 13 from 7 to 5
move 4 from 7 to 8
move 7 from 8 to 1
move 3 from 5 to 3
move 3 from 7 to 2
move 1 from 1 to 4
move 1 from 7 to 2
move 3 from 2 to 4
move 8 from 3 to 1
move 11 from 1 to 3
move 12 from 3 to 4
move 1 from 2 to 5
move 18 from 3 to 8
move 3 from 1 to 9
move 1 from 3 to 5
move 15 from 5 to 4
move 4 from 5 to 1
move 23 from 4 to 6
move 3 from 1 to 6
move 13 from 8 to 3
move 25 from 6 to 2
move 1 from 9 to 5
move 5 from 3 to 8
move 17 from 2 to 8
move 4 from 4 to 1
move 1 from 9 to 7
move 5 from 2 to 6
move 2 from 2 to 4
move 1 from 9 to 4
move 6 from 3 to 9
move 16 from 8 to 3
move 2 from 1 to 8
move 1 from 7 to 4
move 5 from 4 to 7
move 1 from 5 to 3
move 2 from 7 to 1
move 9 from 8 to 4
move 3 from 7 to 2
move 2 from 8 to 3
move 10 from 4 to 1
move 1 from 2 to 3
move 5 from 3 to 7
move 2 from 8 to 9
move 2 from 9 to 8
move 1 from 2 to 1
move 3 from 9 to 6
move 2 from 2 to 8
move 4 from 7 to 3
move 4 from 8 to 6
move 1 from 7 to 1
move 1 from 4 to 8
move 4 from 3 to 4
move 4 from 4 to 2
move 6 from 1 to 2
move 1 from 4 to 3
move 5 from 3 to 8
move 6 from 3 to 8
move 2 from 2 to 8
move 3 from 2 to 9
move 8 from 1 to 6
move 3 from 2 to 7
move 2 from 7 to 2
move 13 from 6 to 5
move 7 from 5 to 9
move 3 from 2 to 7
move 1 from 2 to 9
move 2 from 5 to 2
move 3 from 8 to 5
move 5 from 3 to 4
move 2 from 2 to 1
move 9 from 8 to 7
move 1 from 1 to 8
move 6 from 5 to 2
move 4 from 2 to 8
move 4 from 7 to 1
move 1 from 2 to 6
move 5 from 1 to 6
move 1 from 8 to 2
move 1 from 2 to 9
move 13 from 6 to 5
move 2 from 7 to 2
move 1 from 8 to 7
move 4 from 4 to 7
move 1 from 4 to 1
move 4 from 8 to 4
move 6 from 5 to 9
move 2 from 1 to 4
move 1 from 8 to 6
move 11 from 9 to 5
move 1 from 7 to 8
move 1 from 8 to 1
move 1 from 1 to 3
move 6 from 4 to 8
move 1 from 8 to 4
move 1 from 1 to 6
move 6 from 9 to 7
move 1 from 4 to 5
move 3 from 2 to 1
move 1 from 8 to 2
move 1 from 3 to 2
move 20 from 5 to 6
move 3 from 1 to 6
move 2 from 2 to 9
move 3 from 8 to 3
move 5 from 3 to 8
move 1 from 1 to 6
move 2 from 8 to 9
move 7 from 9 to 5
move 3 from 5 to 4
move 3 from 8 to 3
move 9 from 7 to 9
move 1 from 8 to 5
move 7 from 7 to 9
move 2 from 5 to 2
move 9 from 9 to 2
move 1 from 7 to 3
move 2 from 9 to 1
move 2 from 5 to 9
move 2 from 1 to 4
move 2 from 3 to 7
move 18 from 6 to 7
move 7 from 9 to 1
move 7 from 6 to 8
move 4 from 4 to 9
move 4 from 8 to 3
move 2 from 8 to 2
move 1 from 8 to 5
move 1 from 4 to 7
move 1 from 5 to 1
move 2 from 9 to 3
move 12 from 2 to 5
move 6 from 5 to 6
move 5 from 7 to 2
move 3 from 6 to 4
move 1 from 4 to 7
move 1 from 4 to 1
move 2 from 5 to 8
move 1 from 8 to 2
move 2 from 9 to 7
move 8 from 1 to 8
move 11 from 7 to 1
move 5 from 8 to 2
move 7 from 7 to 5
move 1 from 9 to 4
move 1 from 7 to 5
move 7 from 5 to 7
move 2 from 6 to 1
move 1 from 8 to 2
move 12 from 1 to 7
move 2 from 1 to 2
move 3 from 8 to 5
move 3 from 5 to 2
move 8 from 7 to 3
move 1 from 3 to 1
move 3 from 6 to 4
move 4 from 5 to 6
move 14 from 2 to 9
move 3 from 6 to 9
move 3 from 4 to 2
move 1 from 1 to 7
move 1 from 7 to 1
move 3 from 3 to 5
move 8 from 7 to 4
move 1 from 5 to 9
move 3 from 2 to 4
move 1 from 3 to 4
move 4 from 2 to 6
move 2 from 6 to 7
move 3 from 5 to 4
move 16 from 4 to 1
move 7 from 9 to 8
move 1 from 5 to 1
move 3 from 7 to 9
move 3 from 9 to 4
move 7 from 1 to 7
move 6 from 7 to 1
move 5 from 3 to 1
move 11 from 9 to 2
move 3 from 4 to 6
move 9 from 2 to 8
move 6 from 3 to 5
move 2 from 8 to 6
move 5 from 5 to 3
move 2 from 7 to 1
move 3 from 3 to 9
move 1 from 2 to 4
move 1 from 5 to 1
move 13 from 1 to 2
move 5 from 8 to 6
move 2 from 3 to 9
move 2 from 4 to 7
move 5 from 6 to 9
move 7 from 9 to 1
move 3 from 7 to 2
move 6 from 8 to 6
move 5 from 6 to 2
move 2 from 8 to 3
move 2 from 9 to 4
move 6 from 2 to 5
move 1 from 3 to 7
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
def main():
file = open('input.txt', 'r')
buffer = file.read()
print(f"Star 1: Found start-of-packet marker at: {find_uniqe_sequence(buffer, 4)}")
print(f"Star 2: Found start-of-packet marker at: {find_uniqe_sequence(buffer, 14)}")
def find_uniqe_sequence(buffer, bucketSize):
bucket = []
for i in range(0,bucketSize - 1):
bucket.insert(0,buffer[i])
for x in range(bucketSize - 1, len(buffer)):
bucket.insert(0,buffer[x])
if len(bucket) == len(set(bucket)):
return x + 1
else:
bucket.pop()
def star_1(buffer):
bucket = []
bucket.insert(0,buffer[0])
bucket.insert(0,buffer[1])
bucket.insert(0,buffer[2])
for x in range(3, len(buffer)):
bucket.insert(0,buffer[x])
if len(bucket) == len(set(bucket)):
print(f"Star 1: Found start-of-packet marker at: {x + 1}")
break
else:
bucket.pop()
if __name__ == '__main__':
main()
pnnfhnhshrhmhwwmwzmznmnwmwfmfhfjfcjjtgtbggpdgdjjbjrjsjpjrrmddmgmpmddrhddnfnfzfpfvpfpprhhlffmtffqhhdtdcdsswsdwswmmfvvpdprrnnhhhtffnfbbznbznnvdnnbffjrfrbfrbrgbrrntnggrqqwtqwwgjgsswgwqwtwwsvwvbwvwrwlrlppzfzwfzzpmzzhqqzqlzlglzzmrmwrmwwvmwvvnppjfjttlffhjjjsccbggnffqgfgjjnccmdmzmllvnlnznttlvlttvnvgnvvqvmvqqzrqqcgglzzwtztwwmjmzjjnddsffqrqlrrvsvdvldvvlgvlvccdzczcqcpphggtnthhhtbhtttcjtjcjgcjcbbrhbbfrffgjgdgzddcttczzsccbpcpddcpcggmjgjddtcccthccfrccmdmhmddnwddfldffntnptnpttcptcptpfphhmfmwfwmmlblgbgvbvlltqltldttfcfcclgcllmplmlbbjnjzjnzzttnvvgddshddsqddggsqgqddsggdhghjgjhhgchhdmdjmjddgdhghrrphrrpnnqhhjwwqrrcmmslmmszzpgzpzzrmzmznzllnjnnlnbbdvdsdffbpffcmmnznqqcbbzvvjnjvvwqwgqqpnnzwnzwnzwwwlpwpzzfqzfqqwnqnbnfnqnbqqbggqnqdndrrzzlffbbgqgfgrfrqqsddnqnqjjgssqwqwcqcpcrrqppwpjjfnfpffhphwwmcwwznwznnplptlplnlsnlsldslslsffwtwftwtbtdbbjsjcczwwfllwtlwtlwlvwlwrwppsggvcvrrqcrqqvmqvmmbrrsbsfspspjpnnmpmqmcczgzffqmfmtmpppwzppzrpzrzsrrpqrpqpmpvmpvpttbqtqmtmjttqdqgggcppclcjcpcsppctpplpdpcppcmmdzmzddvhvhnhrrldllcwwbnwnssshlhrhthggtmggbjbjwwbvbttjllvrrfggngvngnmmvzzrrmddmcddztztctfccqpcpcqqvqppqcqdcdhhvhssgfgzgwwzmmnssvwwbqbhbnhnphpqqjcqcddfwfttqjtqtlttglljgjbgjgnnsqqvrvffqvqfqbffljjpffssqdsqstqqqldqqmhmsmsqqwtqwqdqgdgjjfbjffgbbrhhqghgppqgpgmpmmfzfhhfrhffgmfggpzgpzzhtzhhlbhhqbbzvvnvqnntptmmbhbdhdwwmjjcnnmsscqcbbtjtvjvwjvvmsmjmtmpmgghttcztzggpddbfbfgbbdsdrsrrqfqjjqfjjhzhtzzmdzzcgzgdzzmvmmfmjmgjmggmppbdppmzpppvfppzhhfsfwfhhpjpmmrjjpssdccjpjpwjppvdpphcpcjcfjfwjfwfjwfjjqcqcwqqqsmmmbbgdgwwpcwwdfdlflrltlgtthfhfjhhlthtddlgdggsjsrrdpdcppgttphpgpwppmpzmmrjmmvjvgvgfglfgllbqlqhllszzlwwhzzdfdcdtctptwtztfzzmjzjtjtrjrcrnrjjmwmnnbddgvgtgsstjsszmpqdmzgqflrbrspjmtzjcrmlzltmhgblghnwqvwwqwzbpnfrpdpblpjgshfccfbjfsnwvvhnjftsdnsgtzzjtzpmtfdvzrhtqpblhwgmqtgpbfvbdmsnrrrvvbstpsznvbbwgjfqjrhdvwvgptpglpfddhddmtglmjlpwlvfpbtbmgbplbzrlpdlvqzcwhbscpszgfstjpfdvfpmljlngrbgrdnnblzqrfpzsdvblpwbtnhdjclldvwvbwcwzfzbdspgwpfqjfbdbrqcshtlvcrdstnzggbwqnzbrfzbpnrtmvpbvdhcvdsdshgtvhfgdzljflppqbwclnvbhbczvrscjhlbgbfvwdjhnjsgmvwhpfgwbbmnndpnglfrmtfdzvqgfjdqfhgrhvpbqndmqnqccgwswwdsqjnbjtjbjdbqgjnmfbdvlnfwbnrdqgvgzzhmmbbdzfdvvpwhpbwbnzdcdpchrwlhfsjnhhjggvplmqggwjdsvjtpnpnqgldjjdcscrdltssjdrpcrfbgbcjfplhzgwbprfcslhpcngtszrghmwhzdqscbfrhzdwcffzvmjrmcjcstfvhplvrsglgsjnjtrpddsdfqjsndjnfmvdhfgdbzzflqhsrrwmrnlpqzmcddqbqvvzgtlztpgjnddtcnbmqsjlhmcszrmcjvwzpptlfqsmpvgnzvrjdwzpdwqgbmdgdtvjlmfczthjbcgfhbqpnmlbmrwwhfptzlbmfdhssznjcvjbmnjtnvzjhzczlrrdnttmmcbnzhqpplzqwgttwrnwfvmnptgqlfrnzvqpjfgrzwmlcwvtptvcvrlsrdwdgqfvffspmdbnnrqjttpqvhvdpbcrvzptwnhhfsqzchmncvttcdgdnlppcfzpmjpvbvqhlvplwvrmmbbggbwttwmvsqjlllsftprsmtmnzjcqfzblrllzgshfljchrjwjlpvhpbrtrsschzltrblgjnbgdnmwdggjhqggntblnhsvfgsbcblhmctbqzqwmhqnjhpzjfqpjdgwpzhczcftfcpdhvzhzccmwmrfrbqshzmtpqgpbbvfqqbjbmvnlnlwjtzrpmhdlffccrqcfgsjfszbrzrfztntchtmgmbhjgmlsqzcbtqqjzzlghtzzqmlnnvsgsvbbjfgqsqbqmqrdzwpwdgbggpdvhvnlzshhntprjdwhnwfvdjzpqgflwrvwgtmfdmfdztcbtfnjdrvgdwwczdgphnvdgrbdchprqldfjrvcsflcmlcmzqvqgsgnzcgmrhccgcmptcdzhbcdgdtppwztfstzqqzqrdzlnzthggjmpcflmbcmdrrjnnpbpqfmjbzqbtsjjgdlmgncbmgspqqvbrvzrdjscpzjsdtcdvsdwqlmwrngttswnrsbqctvhgfnnwblpcqzdmzpfchplslspmghvgcqntmlrfhgpcbpspvfhnvqvglsqzsnsdzddqpbsjhlclslngbwvvgjhwfcncqsmqwbptzvpzlzslsjjjldjpwpfrdlfbjphqcjtsgqdsdfdjhqgdhcppndwmhmmldvvmblcqcqfqhltbcbvrnghjfmtgqwtwljtczvqlnmgscjhqdhnzwhzvzzqnlsrhqvljqpgpwghfqlhjjrrhvnmnnrbnlhdcjctwtlhmhhmhjvcgzdrzmdjrvqzgnsttjdwglgwlcmbcdnjprgfsbbdzzngbqdrvwwwhbtlnnmzqdjttsrrpvlfdqnfhhtdtvmpcjgdwtbnqmwmtszdqfmbhjsjpqqddzfggwjhbtlnqfgcwbjzdtcpcpzgnrmnvwlpgmwfjlpgppdfrfvvjwsfcdqdnpcpjbqsvhttssgptqjghctrbgntlfjzdrfjccsprsjlrrwrzsmnjsqslmpdtrvhlqbnmgpjthpqdqmnvrtzlhhzzfzbrcclpmpcszhbttgrtcpgcpjwpdbfpfvgspsgtvglwthqcmcvmrfmclwlvjlsptfgmtlrnsvjrnfwzhdcsmgztpzfcvzwdztpppvqpvqfpdrsfnlhrbqwrsqjtwjmhnpwmqmpdgdhbtbpfwnmswffdqffdggrdrpmngvpzplmmwlddnhcvjjzqqfsbbtfmzdwnpvbjrshmllczhgvwwcbcbtfrfnplqjwmjlvpwwgfrtffwddwppsgtnlmpvfnhfzcsgjbqbjmbvpnqppsrvwnlzvcmjqgtbzrdsnrgwbfmrvnflgccrssfvcwgllqqbbcthzmbtnsmbzbcczhtzcvmthttpltrtdmgspctvtpvqbhmnnpnjwmhpqclmjsdrbjwvjbtzcjlqbjsvbgdwqzflnwzcfjwtrhjgfshfmwbjfwpnhjsmtpgbpwlfjjnmdlrhchmnfmgmgcrftmwbzshdwbhndgwtjbrrvbwprqppfmgfmfllpcjgrwdmtzddthsjlgjljv
this documentation is autogenerated. Add a README.adoc
to your solution to take over the control of this :-)
class Folder:
def __init__(self, name, parent):
self.name = name
self.parent = parent
self.folders = {}
self.files = []
self.size = 0
def printContent(self):
print(f"{self.name}")
print("children:")
for folder in self.folders.values():
folder.printContent()
for file in self.files:
print(f"{file.name}: {file.get_size()}")
def get_folder(self, folder):
return self.folders[folder]
def get_folders(self):
return self.folders
def add_file(self, file):
self.files.append(file)
def add_folder(self,folder):
self.folders[folder.name] = folder
def get_size(self):
size = 0
for file in self.files:
size += file.get_size()
for folder in self.folders.values():
size += folder.get_size()
return size
def get_sizes_of_directories(self):
sizes = []
for folder in self.folders.values():
sizes += folder.get_sizes_of_directories()
sizes.append(self.get_size())
return sizes
class File:
def __init__(self, name, size):
self.name = name
self.size = size
def get_size(self):
return self.size
def main():
root = Folder('root', None)
file = open('input.txt', 'r')
commands = file.read().split("$")
commands.pop(0)
current_node = root
for command in commands:
command = command.splitlines()
instruction = command.pop(0).split()
result = command
if instruction[0] == "cd":
if instruction[1] == "/":
current_node = root
elif instruction[1] == "..":
current_node = current_node.parent
else:
current_node = current_node.get_folder(instruction[1])
if instruction[0] == "ls":
for object in result:
object = object.split()
if object[0] == 'dir':
myFolder = Folder(object[1], current_node)
current_node.add_folder(myFolder)
else:
current_node.add_file(File(object[1], int(object[0])))
# root.printContent()
sizes = root.get_sizes_of_directories()
sum = 0
for size in sizes:
if size <= 100000:
sum += size
print(f"Solution Star 1 is {sum}")
currently_free = 70000000 - root.get_size()
print(f"Currently {currently_free} are free.")
required_space = 30000000 - currently_free
print(f"At least {required_space} must be removed.")
smallest_folder_to_delete = None
smallest_extra_space = 70000000
for size in sizes:
extra_unused = size - required_space
if extra_unused >= 0:
if extra_unused < smallest_extra_space:
smallest_extra_space = extra_unused
smallest_folder_to_delete = size
print(f"Star 2: The smalles folder to delete is: {smallest_folder_to_delete}")
if __name__ == '__main__':
main()
$ cd /
$ ls
dir fwbjchs
dir hmnpr
dir jtrbrcjl
dir lcgv
dir ldqc
dir vrvl
$ cd fwbjchs
$ ls
154619 wqdlv.mdw
21648 wvbnz
$ cd ..
$ cd hmnpr
$ ls
178623 rftqqsrp.bfm
$ cd ..
$ cd jtrbrcjl
$ ls
dir nmbfwc
dir whqb
$ cd nmbfwc
$ ls
242645 lcgv
256365 wdzw.drg
$ cd ..
$ cd whqb
$ ls
161522 mrqgpv.gsm
48062 vpsgcl.gfh
$ cd ..
$ cd ..
$ cd lcgv
$ ls
dir cthtlwds
dir grldv
dir lnztfr
dir vwhf
dir znmzg
$ cd cthtlwds
$ ls
dir dghvw
dir tfwgg
$ cd dghvw
$ ls
107090 jmj.lzh
$ cd ..
$ cd tfwgg
$ ls
dir ddnfmsjc
252616 fvj
dir gng
dir lcgv
234528 mpb
181198 pzqgf.cjd
dir svvz
$ cd ddnfmsjc
$ ls
dir hwmcsdvt
dir lcgv
$ cd hwmcsdvt
$ ls
208912 wdzw.drg
$ cd ..
$ cd lcgv
$ ls
47252 tnd.ztd
$ cd ..
$ cd ..
$ cd gng
$ ls
44313 pzqgf.cjd
$ cd ..
$ cd lcgv
$ ls
182616 wdzw.drg
$ cd ..
$ cd svvz
$ ls
86968 sqtggfv
33927 vfmltgs
$ cd ..
$ cd ..
$ cd ..
$ cd grldv
$ ls
145761 mrqgpv.gsm
dir wqdlv
$ cd wqdlv
$ ls
96902 jhmsp
157064 mrqgpv.gsm
$ cd ..
$ cd ..
$ cd lnztfr
$ ls
137978 bpq
180941 fvpfmwn
148685 hsg.qgj
865 mrqgpv.gsm
$ cd ..
$ cd vwhf
$ ls
dir bgtgqzz
dir fcwzw
dir lcgv
dir mrlvtb
116134 mrqgpv.gsm
dir wszvqd
$ cd bgtgqzz
$ ls
dir dzpjg
283411 nmbfwc
dir smhhzq
240602 ttlbcssq
$ cd dzpjg
$ ls
75545 cmfw.gsj
189219 lcgv.chq
255580 lqndrsh.szf
175733 mrqgpv.gsm
$ cd ..
$ cd smhhzq
$ ls
137259 thjwcz.qhn
$ cd ..
$ cd ..
$ cd fcwzw
$ ls
59717 tpljg
$ cd ..
$ cd lcgv
$ ls
148881 mrzcdzd.gjt
68671 pzqgf.cjd
242866 slpftp
89945 vpsgcl.gfh
196497 wdzw.drg
$ cd ..
$ cd mrlvtb
$ ls
40003 rfzrwc.zjn
$ cd ..
$ cd wszvqd
$ ls
dir bhhtbv
dir lcpvwdq
$ cd bhhtbv
$ ls
dir fbh
248604 ldscpjmp
dir nmbfwc
$ cd fbh
$ ls
256295 vpsgcl.gfh
$ cd ..
$ cd nmbfwc
$ ls
83799 lcgv.vfc
$ cd ..
$ cd ..
$ cd lcpvwdq
$ ls
dir lwhq
212569 rfzrwc.clp
23957 wdzw.drg
$ cd lwhq
$ ls
240867 fzrwpl.hqd
68771 mzsqgswh
88777 pqtqv.qwz
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd znmzg
$ ls
30277 gltpwzg.gjd
211983 wdzw.drg
$ cd ..
$ cd ..
$ cd ldqc
$ ls
dir dnzfqzwv
dir dvshtm
97119 gdnlwmbf
dir gqb
dir jclb
dir jgbsw
115989 lcgv.hlf
255836 lchqqdh.wrn
dir qtdlb
dir rmljszcj
dir tqwpmw
dir vhdgcsw
$ cd dnzfqzwv
$ ls
dir tqv
$ cd tqv
$ ls
139984 dwhz.nhz
240411 pzqgf.cjd
129386 rnnr
190691 svgwt.mql
$ cd ..
$ cd ..
$ cd dvshtm
$ ls
dir lcgv
96767 mrqgpv.gsm
dir qdmmpq
$ cd lcgv
$ ls
82949 bldf.hwn
$ cd ..
$ cd qdmmpq
$ ls
dir lzgwflt
dir vgrdpbg
$ cd lzgwflt
$ ls
148651 tndbwbh
$ cd ..
$ cd vgrdpbg
$ ls
dir wqdlv
$ cd wqdlv
$ ls
130393 rqjc.dnr
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd gqb
$ ls
dir jtf
dir lvwpqs
212592 mrzcdzd.gjt
70051 tqpwdwm.nzz
dir vznbng
52226 wbsdrsfh.tfw
$ cd jtf
$ ls
232635 lvpccb.dmm
105086 wdzw.drg
$ cd ..
$ cd lvwpqs
$ ls
124821 dmhqlt
265915 mrqgpv.gsm
45481 pzqgf.cjd
$ cd ..
$ cd vznbng
$ ls
42179 nrzcpgvl.jft
17752 tld.ghn
174859 zvqglbw.ppl
$ cd ..
$ cd ..
$ cd jclb
$ ls
dir bnz
dir dtmtvbw
dir hnlrtpbz
dir pbb
dir vhjwtq
dir vpfggv
dir zmflq
$ cd bnz
$ ls
199447 mrzcdzd.gjt
$ cd ..
$ cd dtmtvbw
$ ls
dir bjthn
dir hzlhz
dir zmflq
$ cd bjthn
$ ls
272777 pgqfn.tdd
$ cd ..
$ cd hzlhz
$ ls
50958 lcgv.gvq
$ cd ..
$ cd zmflq
$ ls
207442 rrnwns.zpf
15759 wdzw.drg
$ cd ..
$ cd ..
$ cd hnlrtpbz
$ ls
69788 jhqjs.sdj
219666 jljzp.mhf
137518 jqnfg
108183 shfjz.vnr
130164 vpsgcl.gfh
$ cd ..
$ cd pbb
$ ls
dir wqdlv
dir zmflq
$ cd wqdlv
$ ls
dir fgggwt
dir hrghbhj
dir nmbfwc
dir tgmqnq
146479 vpsgcl.gfh
dir wqdlv
$ cd fgggwt
$ ls
264892 wqdlv.zsp
$ cd ..
$ cd hrghbhj
$ ls
116698 bfwtbg
dir lcgv
92758 pzqgf.cjd
dir tsdjgt
284427 vpsgcl.gfh
229621 wqdlv.pml
dir zfjjncvd
$ cd lcgv
$ ls
30459 mrzcdzd.gjt
dir wqdlv
$ cd wqdlv
$ ls
78475 wdzw.drg
$ cd ..
$ cd ..
$ cd tsdjgt
$ ls
166330 jpfms
16410 tjswm.bqv
$ cd ..
$ cd zfjjncvd
$ ls
59841 mrqgpv.gsm
$ cd ..
$ cd ..
$ cd nmbfwc
$ ls
dir jtn
151403 mmjm
240129 mmsb
206021 nmbfwc.sds
84439 vpsgcl.gfh
dir wqdlv
dir zvnrwfhn
$ cd jtn
$ ls
23555 hmmt.gbb
$ cd ..
$ cd wqdlv
$ ls
69742 jppj.vvg
$ cd ..
$ cd zvnrwfhn
$ ls
242009 lcgv.bds
$ cd ..
$ cd ..
$ cd tgmqnq
$ ls
259985 bzqjt
46410 flsm.szr
dir lcgv
89561 npfmc.vqs
17503 vpsgcl.gfh
73719 wqdlv.gjn
$ cd lcgv
$ ls
dir dzfglmz
177553 ffvzsgz
dir ljt
216443 mrzcdzd.gjt
255381 nmbfwc
dir rplqnt
84061 zmflq.vlw
$ cd dzfglmz
$ ls
220883 dqbcfgfd
$ cd ..
$ cd ljt
$ ls
11842 rfzrwc.hpn
$ cd ..
$ cd rplqnt
$ ls
119893 lszmvzst.zng
$ cd ..
$ cd ..
$ cd ..
$ cd wqdlv
$ ls
dir chnpddzn
272999 hbhwqt.fsl
144546 jvhjnsz
dir ppsm
102615 pzqgf.cjd
dir swdnss
$ cd chnpddzn
$ ls
256977 pzqgf.cjd
dir wqdlv
$ cd wqdlv
$ ls
6565 hlcqgmj
$ cd ..
$ cd ..
$ cd ppsm
$ ls
238358 fvw.bzw
dir ggjnl
265010 mrzcdzd.gjt
201818 rfzrwc
dir ssggblm
$ cd ggjnl
$ ls
45841 nlnrrqf.fwn
$ cd ..
$ cd ssggblm
$ ls
276584 djqb.ngq
18926 lcgv
$ cd ..
$ cd ..
$ cd swdnss
$ ls
dir bmrzhjs
$ cd bmrzhjs
$ ls
269825 mrqgpv.gsm
3162 rdmbdwq.bmv
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd zmflq
$ ls
dir hnrnldw
dir lcgv
dir mpmcghz
dir nbbv
dir qsnfzp
dir tntnjg
dir wqdlv
$ cd hnrnldw
$ ls
102631 wjbbjwtm.vvz
$ cd ..
$ cd lcgv
$ ls
dir dzz
dir hbzzf
dir jncrbhc
205204 lqnrp
dir mzzpfnr
dir nmbfwc
dir rfzrwc
dir rnrmhfz
dir zmflq
$ cd dzz
$ ls
dir cvvdv
226221 nggtqdzn
94641 npmpjnjm.bzg
dir rsdw
dir sjrb
41983 vfdz.ngz
271561 zmflq.zsc
$ cd cvvdv
$ ls
64260 hhqv.tsg
31245 pzqgf.cjd
280268 znjjp
$ cd ..
$ cd rsdw
$ ls
dir lcgv
$ cd lcgv
$ ls
37080 nmbfwc
$ cd ..
$ cd ..
$ cd sjrb
$ ls
233530 mrqgpv.gsm
$ cd ..
$ cd ..
$ cd hbzzf
$ ls
36018 mrqgpv.gsm
$ cd ..
$ cd jncrbhc
$ ls
205345 mrqgpv.gsm
244683 nqpcpt
$ cd ..
$ cd mzzpfnr
$ ls
dir hmjzlr
dir lcgv
dir mczs
dir wqdlv
90391 wqdlv.pdr
144119 zmflq
$ cd hmjzlr
$ ls
268342 svsd.jcd
$ cd ..
$ cd lcgv
$ ls
dir pwhl
dir rfzrwc
$ cd pwhl
$ ls
42795 gvmt
82576 wdzw.drg
$ cd ..
$ cd rfzrwc
$ ls
dir jjl
dir mqp
156985 mrqgpv.gsm
dir wptr
dir wqdlv
$ cd jjl
$ ls
dir jrjjr
104785 nmbfwc
20108 wdzw.drg
$ cd jrjjr
$ ls
243753 hgndlcrv.wbc
$ cd ..
$ cd ..
$ cd mqp
$ ls
142621 cljnbs
$ cd ..
$ cd wptr
$ ls
46279 vjqlvhrh.njr
$ cd ..
$ cd wqdlv
$ ls
104474 vpsgcl.gfh
$ cd ..
$ cd ..
$ cd ..
$ cd mczs
$ ls
186843 mrqgpv.gsm
dir pjm
dir thbwb
$ cd pjm
$ ls
dir wqdlv
$ cd wqdlv
$ ls
201647 sgtt
$ cd ..
$ cd ..
$ cd thbwb
$ ls
146494 mrqgpv.gsm
$ cd ..
$ cd ..
$ cd wqdlv
$ ls
103876 mrqgpv.gsm
$ cd ..
$ cd ..
$ cd nmbfwc
$ ls
dir fgctdds
dir rwgscjbv
$ cd fgctdds
$ ls
205015 bwvshdcz.dpp
$ cd ..
$ cd rwgscjbv
$ ls
242899 rbmtfdhp
$ cd ..
$ cd ..
$ cd rfzrwc
$ ls
dir bnsgzwhn
228624 ffj
dir lcgv
dir rcvwcbfd
268775 vbhsh.nnz
129373 vpsgcl.gfh
68919 wqdlv
dir wqmdw
dir zmflq
153277 zmflq.frv
$ cd bnsgzwhn
$ ls
9892 ltcrrzhb.njc
dir wpwmflr
dir zmflq
$ cd wpwmflr
$ ls
274142 bfj.fbw
dir rfzrwc
dir srnm
$ cd rfzrwc
$ ls
161517 mrqgpv.gsm
dir zbhgwsd
$ cd zbhgwsd
$ ls
43750 vbqmpbcr.zwz
$ cd ..
$ cd ..
$ cd srnm
$ ls
dir rvvtgr
$ cd rvvtgr
$ ls
164604 wzgbzbn
$ cd ..
$ cd ..
$ cd ..
$ cd zmflq
$ ls
184482 mrqgpv.gsm
80280 pzqgf.cjd
183303 zln.tbm
$ cd ..
$ cd ..
$ cd lcgv
$ ls
dir lcgv
dir pqttlp
$ cd lcgv
$ ls
dir bpjzg
$ cd bpjzg
$ ls
99853 wdzw.drg
$ cd ..
$ cd ..
$ cd pqttlp
$ ls
dir bgvhcgfn
45115 mrzcdzd.gjt
248058 qnvhgpw.ddw
112129 rfzrwc
$ cd bgvhcgfn
$ ls
228291 nmbfwc.gqj
$ cd ..
$ cd ..
$ cd ..
$ cd rcvwcbfd
$ ls
dir vtrtt
dir wgp
$ cd vtrtt
$ ls
138009 pzqgf.cjd
dir ztsvzpn
$ cd ztsvzpn
$ ls
51632 vpsgcl.gfh
$ cd ..
$ cd ..
$ cd wgp
$ ls
81030 lcgv.zhv
$ cd ..
$ cd ..
$ cd wqmdw
$ ls
dir zmrdf
$ cd zmrdf
$ ls
dir qqgw
$ cd qqgw
$ ls
58554 gqpqvplc.zvr
$ cd ..
$ cd ..
$ cd ..
$ cd zmflq
$ ls
224544 mrzcdzd.gjt
254976 pzqgf.cjd
$ cd ..
$ cd ..
$ cd rnrmhfz
$ ls
19759 lcgv.stz
$ cd ..
$ cd zmflq
$ ls
22390 nftzlqg.qmp
80148 wqdlv
$ cd ..
$ cd ..
$ cd mpmcghz
$ ls
169324 mrqgpv.gsm
65924 wdzw.drg
$ cd ..
$ cd nbbv
$ ls
115297 bqcrc.prw
58148 pvzv.qwf
dir wqdlv
$ cd wqdlv
$ ls
145268 mrzcdzd.gjt
35745 nmbfwc.hgv
112142 wqdlv
$ cd ..
$ cd ..
$ cd qsnfzp
$ ls
241308 nmbfwc.hmg
$ cd ..
$ cd tntnjg
$ ls
19543 mrqgpv.gsm
667 wqdlv
$ cd ..
$ cd wqdlv
$ ls
dir dqpgtmdl
dir jrqsqrv
189727 mrzcdzd.gjt
dir rfzrwc
208280 vpsgcl.gfh
281557 vwsljgn.mwd
119829 zmflq.hgd
$ cd dqpgtmdl
$ ls
268413 qcw.slb
$ cd ..
$ cd jrqsqrv
$ ls
238387 mvllmjc.wvm
213020 nqp.gdr
157257 nzdmplg.zqh
dir ppwcgc
24914 pzqgf.cjd
dir zjr
dir zmflq
$ cd ppwcgc
$ ls
249714 bsrnnhrr.spq
dir cvnd
$ cd cvnd
$ ls
248610 pzqgf.cjd
$ cd ..
$ cd ..
$ cd zjr
$ ls
224145 smwb.mmz
$ cd ..
$ cd zmflq
$ ls
250519 ftggp
147304 vpsgcl.gfh
238706 wdzw.drg
258323 wqdlv.bjp
dir wqgngf
$ cd wqgngf
$ ls
14302 bdz.jdw
dir jpgfsgd
dir ldwgr
22718 nwfh.nzf
$ cd jpgfsgd
$ ls
dir lcgv
dir qbrwz
$ cd lcgv
$ ls
284229 qhwc.zpq
dir wsjs
$ cd wsjs
$ ls
111635 lcgv
$ cd ..
$ cd ..
$ cd qbrwz
$ ls
199057 gpssftw.wdb
$ cd ..
$ cd ..
$ cd ldwgr
$ ls
260404 gdnpg.vjb
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd rfzrwc
$ ls
dir lmcg
$ cd lmcg
$ ls
32819 sjjztgr.rfj
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd vhjwtq
$ ls
dir qgqbrv
$ cd qgqbrv
$ ls
176900 gwbnqtn.rnj
$ cd ..
$ cd ..
$ cd vpfggv
$ ls
144809 cmc.srv
117565 nhddq.bqn
dir scw
dir tpmnhdc
dir vvp
71774 wqdlv.gdm
61647 zmflq
174026 zmflq.wzn
$ cd scw
$ ls
2295 bqbsrj.gnc
243386 mfmdqhh.mzl
$ cd ..
$ cd tpmnhdc
$ ls
dir fjwr
dir lcllz
dir nmbfwc
$ cd fjwr
$ ls
133256 pwgtqz.dpm
159987 vpsgcl.gfh
$ cd ..
$ cd lcllz
$ ls
dir flwws
210654 qmbfw.bsv
dir zmflq
$ cd flwws
$ ls
222222 nmbfwc.vhj
$ cd ..
$ cd zmflq
$ ls
235011 jlzfbt.wlb
49525 rfzrwc.fnc
$ cd ..
$ cd ..
$ cd nmbfwc
$ ls
133730 dqdqhvm
dir lcgv
188291 nmbfwc.qhv
110039 wdzw.drg
249996 wqdlv
dir zmflq
dir zppcvq
$ cd lcgv
$ ls
dir wths
$ cd wths
$ ls
120313 jdbtlf.rrn
$ cd ..
$ cd ..
$ cd zmflq
$ ls
124906 dqdcpzh
$ cd ..
$ cd zppcvq
$ ls
112537 mrzcdzd.gjt
$ cd ..
$ cd ..
$ cd ..
$ cd vvp
$ ls
dir fsw
194927 hvlm.pbd
dir nmbfwc
230376 pgsq
$ cd fsw
$ ls
111889 nmbfwc.smt
dir rfzrwc
$ cd rfzrwc
$ ls
282718 gbvss
$ cd ..
$ cd ..
$ cd nmbfwc
$ ls
dir fvh
160971 ngqvztv.hfg
dir rfzrwc
$ cd fvh
$ ls
256956 mrqgpv.gsm
14363 vbvsncs.jjw
172959 wdzw.drg
$ cd ..
$ cd rfzrwc
$ ls
257264 vpsgcl.gfh
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd zmflq
$ ls
10486 lbdtpnps.jhq
118145 rlgjvn.nvf
176390 wdzw.drg
$ cd ..
$ cd ..
$ cd jgbsw
$ ls
dir cfdljgh
214846 dwqdqv.ftq
dir rfzrwc
147094 vpsgcl.gfh
$ cd cfdljgh
$ ls
261471 mrqgpv.gsm
$ cd ..
$ cd rfzrwc
$ ls
dir fcvfw
dir gvqrwgrs
57417 zfqrqv.fvp
$ cd fcvfw
$ ls
279614 wdzw.drg
$ cd ..
$ cd gvqrwgrs
$ ls
dir sgfltf
$ cd sgfltf
$ ls
204207 mstlc.wtj
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd qtdlb
$ ls
dir gjpmcvwp
dir nsjlcmfz
dir wqdlv
$ cd gjpmcvwp
$ ls
dir cjjdzcwm
$ cd cjjdzcwm
$ ls
233873 pdnsrz.vfp
$ cd ..
$ cd ..
$ cd nsjlcmfz
$ ls
53472 nmbfwc
dir qvpj
$ cd qvpj
$ ls
150929 mrzcdzd.gjt
$ cd ..
$ cd ..
$ cd wqdlv
$ ls
dir qccsnjd
$ cd qccsnjd
$ ls
65908 hsrqhn.hjr
267802 zmflq.jdt
$ cd ..
$ cd ..
$ cd ..
$ cd rmljszcj
$ ls
dir jnstrbj
172566 nbtszsgl
dir wqdlv
$ cd jnstrbj
$ ls
232158 fgccmchh.wqg
236339 mrqgpv.gsm
281875 rfzrwc.sfd
$ cd ..
$ cd wqdlv
$ ls
58492 wdzw.drg
213853 wqdlv.zlz
$ cd ..
$ cd ..
$ cd tqwpmw
$ ls
92747 pzqgf.cjd
$ cd ..
$ cd vhdgcsw
$ ls
125104 crfw.sfv
dir flhbhzlt
139949 mrqgpv.gsm
dir rfzrwc
dir rnz
97174 zmflq.vpn
$ cd flhbhzlt
$ ls
282258 mrzcdzd.gjt
$ cd ..
$ cd rfzrwc
$ ls
dir lcgv
$ cd lcgv
$ ls
dir dlpng
dir glqrj
178245 lcgv
106863 nmbfwc.fgr
$ cd dlpng
$ ls
195950 rfzrwc
$ cd ..
$ cd glqrj
$ ls
248909 pzqgf.cjd
34214 vpsgcl.gfh
$ cd ..
$ cd ..
$ cd ..
$ cd rnz
$ ls
dir chfccv
dir cmsccq
dir zmflq
$ cd chfccv
$ ls
13688 mrqgpv.gsm
162142 vpsgcl.gfh
$ cd ..
$ cd cmsccq
$ ls
94122 dzpsltth
190025 rfzrwc
dir twqt
12230 wgghbcz.tph
60111 wqdlv
$ cd twqt
$ ls
109250 wdzw.drg
$ cd ..
$ cd ..
$ cd zmflq
$ ls
174075 wdzw.drg
$ cd ..
$ cd ..
$ cd ..
$ cd ..
$ cd vrvl
$ ls
dir pnfv
210089 rfzrwc
dir stcfmz
$ cd pnfv
$ ls
183315 rhmztnnh
$ cd ..
$ cd stcfmz
$ ls
115637 lcgv