This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import randint | |
| def thanos_sort(array): | |
| while not is_sorted(array): | |
| target_length = int(len(array)/2) | |
| while len(array) > target_length: | |
| del array[randint(0, len(array)-1)] | |
| return array | |
| def is_sorted(array): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use 5.20.0; | |
| use feature 'postderef'; | |
| no warnings 'experimental::postderef'; | |
| use File::pushd qw( pushd ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #use Grammar::Tracer; | |
| use v6; | |
| grammar ChangeLog { | |
| token TOP { | |
| ^ <entry>+ $ | |
| } | |
| token entry { | |
| <header> | |
| <newsitem>* |