Skip to content

Commit 084c745

Browse files
committed
deploy: 44b8480
1 parent 050a42a commit 084c745

File tree

10 files changed

+7207
-7155
lines changed

10 files changed

+7207
-7155
lines changed

en/lc/1014/index.html

Lines changed: 50 additions & 24 deletions
Large diffs are not rendered by default.

en/lc/1018/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28504,9 +28504,9 @@
2850428504
<ul class="md-nav__list">
2850528505

2850628506
<li class="md-nav__item">
28507-
<a href="#solution-1" class="md-nav__link">
28507+
<a href="#solution-1-simulation" class="md-nav__link">
2850828508
<span class="md-ellipsis">
28509-
Solution 1
28509+
Solution 1: Simulation
2851028510
</span>
2851128511
</a>
2851228512

@@ -79126,7 +79126,9 @@ <h2 id="description">Description</h2>
7912679126
<h2 id="solutions">Solutions</h2>
7912779127
<!-- solution:start -->
7912879128

79129-
<h3 id="solution-1">Solution 1</h3>
79129+
<h3 id="solution-1-simulation">Solution 1: Simulation</h3>
79130+
<p>We use a variable $x$ to represent the current binary prefix, then traverse the array $nums$. For each element $v$, we left shift $x$ by one bit, then add $v$, and take the result modulo $5$. If the result equals $0$, it means the current binary prefix is divisible by $5$, and we add $\textit{true}$ to the answer array; otherwise, we add $\textit{false}$ to the answer array.</p>
79131+
<p>The time complexity is $O(n)$, and ignoring the space consumption of the answer array, the space complexity is $O(1)$.</p>
7913079132
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Python3</label><label for="__tabbed_1_2">Java</label><label for="__tabbed_1_3">C++</label><label for="__tabbed_1_4">Go</label><label for="__tabbed_1_5">TypeScript</label></div>
7913179133
<div class="tabbed-content">
7913279134
<div class="tabbed-block">

en/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)