Write details shortcode so Markdown and quotes inside of details tag are rendered correctly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
cafbacfd3b
commit
0a54a08e19
|
@ -33,12 +33,9 @@ You really think I'll just hand you the solution right away? Go outside and talk
|
||||||
|
|
||||||
OK, if you insist on reading the solution, here it is:
|
OK, if you insist on reading the solution, here it is:
|
||||||
|
|
||||||
{{< rawhtml >}}
|
{{< details "Click to show solution" >}}
|
||||||
<details>
|
|
||||||
<summary>Click to show solution</summary>
|
|
||||||
The subrectangle with the smallest average brightness is just the pixel with the lowest brightness! We can find that in O(NM) time by scanning through the entire array of pixels. I also asked ChatGPT to solve this problem, and its initial attempt was an O(N^3 M^3) brute force. After asking it to improve its solution, it wrote an O(N^2 M^2) program using prefix sums, but couldn't do any better. Yay, I guess that means I have a new favorite problem for stumping LLMs, in addition to my old favorite, "What's the average aspect ratio of a human?"
|
The subrectangle with the smallest average brightness is just the pixel with the lowest brightness! We can find that in O(NM) time by scanning through the entire array of pixels. I also asked ChatGPT to solve this problem, and its initial attempt was an O(N^3 M^3) brute force. After asking it to improve its solution, it wrote an O(N^2 M^2) program using prefix sums, but couldn't do any better. Yay, I guess that means I have a new favorite problem for stumping LLMs, in addition to my old favorite, "What's the average aspect ratio of a human?"
|
||||||
</details>
|
{{< /details >}}
|
||||||
{{< /rawhtml >}}
|
|
||||||
|
|
||||||
## A variant
|
## A variant
|
||||||
|
|
||||||
|
|
4
layouts/shortcodes/details.html
Normal file
4
layouts/shortcodes/details.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<details>
|
||||||
|
<summary>{{ .Get 0 }}</summary>
|
||||||
|
<p>{{ .Inner | markdownify }}</p>
|
||||||
|
</details>
|
|
@ -1,2 +1 @@
|
||||||
<!-- raw html -->
|
{{ .Inner }}
|
||||||
{{.Inner}}
|
|
||||||
|
|
Loading…
Reference in a new issue