Skip to content

Commit faa7685

Browse files
kaili-yangyanglbme
andauthored
chore: update lc problem: No.1797 (doocs#1341)
* fix: prettier format to lc problem: No.1797 * chore: skip question --------- Co-authored-by: kaili-yang <124ykl@gmail.com> Co-authored-by: Yang Libin <contact@yanglibin.info>
1 parent ba49b7f commit faa7685

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

solution/1700-1799/1797.Design Authentication Manager/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1700-1799/1797.Design%20Authentication%20Manager/images/copy-of-pc68_q2.png" style="width: 500px; height: 287px;" />
2626
<pre>
2727
<strong>输入:</strong>
28-
["AuthenticationManager", "<code>renew</code>", "generate", "<code>countUnexpiredTokens</code>", "generate", "<code>renew</code>", "<code>renew</code>", "<code>countUnexpiredTokens</code>"]
28+
["AuthenticationManager", "renew", "generate", "countUnexpiredTokens", "generate", "renew", "renew", "countUnexpiredTokens"]
2929
[[5], ["aaa", 1], ["aaa", 2], [6], ["bbb", 7], ["aaa", 8], ["bbb", 10], [15]]
3030
<strong>输出:</strong>
3131
[null, null, null, 1, null, null, null, 0]
@@ -42,8 +42,6 @@ authenticationManager.<code>countUnexpiredTokens</code>(15); // tokenId 为 "bbb
4242

4343
</pre>
4444

45-
<p> </p>
46-
4745
<p><strong>提示:</strong></p>
4846

4947
<ul>

solution/1700-1799/1797.Design Authentication Manager/README_EN.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1700-1799/1797.Design%20Authentication%20Manager/images/copy-of-pc68_q2.png" style="width: 500px; height: 287px;" />
2323
<pre>
2424
<strong>Input</strong>
25-
[&quot;AuthenticationManager&quot;, &quot;<code>renew</code>&quot;, &quot;generate&quot;, &quot;<code>countUnexpiredTokens</code>&quot;, &quot;generate&quot;, &quot;<code>renew</code>&quot;, &quot;<code>renew</code>&quot;, &quot;<code>countUnexpiredTokens</code>&quot;]
26-
[[5], [&quot;aaa&quot;, 1], [&quot;aaa&quot;, 2], [6], [&quot;bbb&quot;, 7], [&quot;aaa&quot;, 8], [&quot;bbb&quot;, 10], [15]]
25+
["AuthenticationManager", "renew", "generate", "countUnexpiredTokens", "generate", "renew", "renew", "countUnexpiredTokens"]
26+
[[5], ["aaa", 1], ["aaa", 2], [6], ["bbb", 7], ["aaa", 8], ["bbb", 10], [15]]
2727
<strong>Output</strong>
2828
[null, null, null, 1, null, null, null, 0]
2929

3030
<strong>Explanation</strong>
3131
AuthenticationManager authenticationManager = new AuthenticationManager(5); // Constructs the AuthenticationManager with <code>timeToLive</code> = 5 seconds.
32-
authenticationManager.<code>renew</code>(&quot;aaa&quot;, 1); // No token exists with tokenId &quot;aaa&quot; at time 1, so nothing happens.
33-
authenticationManager.generate(&quot;aaa&quot;, 2); // Generates a new token with tokenId &quot;aaa&quot; at time 2.
34-
authenticationManager.<code>countUnexpiredTokens</code>(6); // The token with tokenId &quot;aaa&quot; is the only unexpired one at time 6, so return 1.
35-
authenticationManager.generate(&quot;bbb&quot;, 7); // Generates a new token with tokenId &quot;bbb&quot; at time 7.
36-
authenticationManager.<code>renew</code>(&quot;aaa&quot;, 8); // The token with tokenId &quot;aaa&quot; expired at time 7, and 8 &gt;= 7, so at time 8 the <code>renew</code> request is ignored, and nothing happens.
37-
authenticationManager.<code>renew</code>(&quot;bbb&quot;, 10); // The token with tokenId &quot;bbb&quot; is unexpired at time 10, so the <code>renew</code> request is fulfilled and now the token will expire at time 15.
38-
authenticationManager.<code>countUnexpiredTokens</code>(15); // The token with tokenId &quot;bbb&quot; expires at time 15, and the token with tokenId &quot;aaa&quot; expired at time 7, so currently no token is unexpired, so return 0.
32+
authenticationManager.<code>renew</code>("aaa", 1); // No token exists with tokenId "aaa" at time 1, so nothing happens.
33+
authenticationManager.generate("aaa", 2); // Generates a new token with tokenId "aaa" at time 2.
34+
authenticationManager.<code>countUnexpiredTokens</code>(6); // The token with tokenId "aaa" is the only unexpired one at time 6, so return 1.
35+
authenticationManager.generate("bbb", 7); // Generates a new token with tokenId "bbb" at time 7.
36+
authenticationManager.<code>renew</code>("aaa", 8); // The token with tokenId "aaa" expired at time 7, and 8 &gt;= 7, so at time 8 the <code>renew</code> request is ignored, and nothing happens.
37+
authenticationManager.<code>renew</code>("bbb", 10); // The token with tokenId "bbb" is unexpired at time 10, so the <code>renew</code> request is fulfilled and now the token will expire at time 15.
38+
authenticationManager.<code>countUnexpiredTokens</code>(15); // The token with tokenId "bbb" expires at time 15, and the token with tokenId "aaa" expired at time 7, so currently no token is unexpired, so return 0.
3939

4040
</pre>
4141

solution/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
1717,
4747
1754,
4848
1760,
49+
1797,
4950
1850,
5051
1891,
5152
1899,

0 commit comments

Comments
 (0)