Skip to main content
deleted 102 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Julia, 2828 27 bytes

x->>colon(minextrema(x...):max(x...))∩x

Verification

julia> f = x->(min(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
12-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99

Try it online!

Julia, 28 bytes

x->(min(x...):max(x...))∩x

Verification

julia> f = x->(min(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
12-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99

Julia, 28 27 bytes

x->colon(extrema(x)...)∩x

Try it online!

Rollback to Revision 1
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Julia, 28 2728 bytes

x->range>(extremamin(x...):max(x...))∩x

Verification

julia> f = x->range>(extremamin(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
1012-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99

Julia, 28 27 bytes

x->range(extrema(x)...)∩x

Verification

julia> f = x->range(extrema(x)...)∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
10-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67

Julia, 28 bytes

x->(min(x...):max(x...))∩x

Verification

julia> f = x->(min(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
12-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99
deleted 12 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Julia, 2828 27 bytes

x->>range(minextrema(x...):max(x...))∩x

Verification

julia> f = x->>range(minextrema(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
1210-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99

Julia, 28 bytes

x->(min(x...):max(x...))∩x

Verification

julia> f = x->(min(x...):max(x...))∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
12-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
  88
  99

Julia, 28 27 bytes

x->range(extrema(x)...)∩x

Verification

julia> f = x->range(extrema(x)...)∩x
(anonymous function)

julia> f([99,-2,53,4,67,55,23,43,88,-22,36,45])
10-element Array{Int64,1}:
 -22
  -2
   4
  23
  36
  43
  45
  53
  55
  67
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825
Loading