#!/usr/bin/env perl use strict; use warnings; use utf8; use feature qw{ postderef say signatures state switch }; no warnings qw{ experimental::postderef experimental::smartmatch experimental::signatures }; use Algorithm::Permute; use JSON; my $json = JSON->new->pretty->canonical; my $base = 2019; my @base = split m{},$base; my $iter = Algorithm::Permute->new(\@base); my @list; while ( my @num = $iter->next ) { push @list, join '', @num; } for my $n ( sort @list ) { next if $n <= $base; say $n; exit; }
Why JSON?
Because debugging and forgetting to remove it when done.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Perl 5
Why JSON?
Because debugging and forgetting to remove it when done.