Platform
Resources
Pricing
Sign in
Get started
Visnu Pitiyanuvath
Workspace
Fork
Public
Advent of Code 2022
By
Visnu Pitiyanuvath
Edited
Dec 6, 2022
1 fork
1 star
Insert cell
Insert cell
Insert cell
part2
=
starter
(
data
,
14
)
Insert cell
part1
=
starter
(
data
,
4
)
Insert cell
starter
=
(
s
,
len
=
4
)
=>
{
const
buffer
=
new
Array
(
)
;
let
n
=
0
;
for
(
let
i
=
0
;
i
<
s
.
length
;
i
++
)
{
buffer
[
n
++
]
=
s
[
i
]
;
if
(
new
Set
(
buffer
)
.
size
===
len
)
return
[
i
+
1
,
buffer
]
;
n
=
n
%
len
;
}
}
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sample
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
part2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
part1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
starter
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML