diff --git a/src/Julia/001.jl b/src/Julia/001.jl new file mode 100644 index 0000000..bbd3812 --- /dev/null +++ b/src/Julia/001.jl @@ -0,0 +1,10 @@ +function same_to_next(lst) + return [x for (x, y) in zip(lst[1:end-1], lst[2:end]) if x == y] +end + + +check = [1, 2, 2, 2, 3, 3, 4] +println(same_to_next(check)) # [2, 2, 3] + +check = collect(1:10) +println(same_to_next(check)) # Int64[] \ No newline at end of file