feat(two-pointers): improve code snippet styling

This commit is contained in:
Barrett Ruth 2024-06-17 12:28:17 -05:00
parent 6c97fa2890
commit 683fa2d802
2 changed files with 17 additions and 9 deletions

View file

@ -40,7 +40,7 @@
<time datetime="2024-06-16">16/06/2024</time> <time datetime="2024-06-16">16/06/2024</time>
</p> </p>
</header> </header>
<article> <article class="post-article">
<h2>technique overview</h2> <h2>technique overview</h2>
<h3> <h3>
<a <a
@ -71,8 +71,8 @@
potentially new largest area. A running maximizum, the answer, is potentially new largest area. A running maximizum, the answer, is
maintained. maintained.
</p> </p>
<pre><code class="language-python"> <div class="post-code">
def maxArea(height: list[int]) -> int: <pre><code class="language-python">def maxArea(height: list[int]) -> int:
area = 0 area = 0
l, r = 0, len(height) - 1 l, r = 0, len(height) - 1
while l < r: while l < r:
@ -82,8 +82,8 @@ def maxArea(height: list[int]) -> int:
l += 1 l += 1
while l < r and height[r] <= min_height: while l < r and height[r] <= min_height:
r -= 1 r -= 1
return area return area</code></pre>
</code></pre> </div>
<!-- <h3> --> <!-- <h3> -->
<!-- <a --> <!-- <a -->
<!-- target="blank" --> <!-- target="blank" -->

View file

@ -62,21 +62,29 @@ header {
left: -20px; left: -20px;
} }
article { .post-article {
font-size: 1.5em; font-size: 1.5em;
line-height: 1.3em; line-height: 1.3em;
padding-bottom: 50px; padding-bottom: 50px;
} }
article h2 { .post-article h2 {
font-weight: normal; font-weight: normal;
font-style: italic; font-style: italic;
} }
article h3 { .post-article h3 {
font-weight: normal; font-weight: normal;
} }
article a { .post-article a {
text-decoration: underline; text-decoration: underline;
} }
.post-code {
display: flex;
justify-content: center;
}
.language-python {
font-size: 0.9em !important;
}