! Copyright (c) 2010 Aaron Schaefer. All rights reserved.
! The contents of this file are licensed under the Simplified BSD License
! A copy of the license is available at http://factorcode.org/license.txt
-USING: grouping kernel math math.ranges project-euler.common
+USING: grouping kernel math project-euler.common ranges
sequences sequences.cords ;
IN: project-euler.206
CONSTANT: hi 1389026570
: form-fitting? ( n -- ? )
- number>digits 2 group keys
- { 1 2 3 4 5 6 7 8 9 0 } = ;
+ number>digits 2 group [ first ] map
+ { 1 2 3 4 5 6 7 8 9 0 } sequence= ;
: candidates ( -- seq )
lo lo 40 + [ hi 100 <range> ] bi@ cord-append ;