| Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
|---|---|---|---|---|---|---|
| 1 | Python | 290 | 145 | 145 | 12 months ago | |
| 2 | Python | 307 | 137 | 170 | 12 months ago | |
| 3 | JavaScript | 10143 | 143 | - | 12 months ago |
importsysfat=[int(c)forcinsys.stdin.read().strip()]blockmap=[None]*sum(fat)pos=0fori,blocksinenumerate(fat): if(i&1)==0: fileid=i>>1 blockmap[pos:pos+blocks]=[fileid]*blocks pos+=blockswhileTrue: whileblockmap[-1]isNone: blockmap.pop() try: next_free=blockmap.index(None) exceptValueError: break blockmap[next_free]=blockmap.pop()print(sum(a*bfora,binenumerate(blockmap)))