Skip to main content
deleted 15 characters in body
Source Link
user92069
user92069

Io, 110104 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=xasList;x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all  // All slices of x of length n
    O unique                         // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

Io, 110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all slices of x of length n
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

Io, 104 bytes

method(x,n,K :=Range 1 to(n)asList;x map(i,v,x slice(i,i+n))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    x map(i,v,x slice(i,i+n))      // All slices of x of length n
    unique                         // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)
added 10 characters in body
Source Link
user92069
user92069

Io, 110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the tbd string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all n-slices of x of length n
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

Io, 110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the tbd string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all n-slices of x
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

Io, 110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all slices of x of length n
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)
added 308 characters in body
Source Link
user92069
user92069

Io, 129110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the tbd string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(0i,i+n)) // O size= all n-n+1)slices of x
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x)size==K == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

Try it online!

Io, 129 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))slice(0,O size-n+1)unique select(x,x sort==K)size==K reduce(*))

Try it online!

Io, 110 bytes

method(x,n,K :=Range 1 to(n)asList;(O :=x map(i,v,x slice(i,i+n)))unique select(x,x sort==K)size==K reduce(*))

Try it online!

Explanation (Ungolfed)

method(x,n,                        // Take the tbd string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    O := x map(i,v,x slice(i,i+n)) // O = all n-slices of x
    O unique                       // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)
deleted 77 characters in body
Source Link
user92069
user92069
Loading
Post Undeleted by user92069
Post Deleted by user92069
Source Link
user92069
user92069
Loading