You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solution/0700-0799/0729.My Calendar I/README_EN.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,13 @@ tags:
24
24
25
25
<p>A <strong>double booking</strong> happens when two events have some non-empty intersection (i.e., some moment is common to both events.).</p>
26
26
27
-
<p>The event can be represented as a pair of integers <code>start</code> and <code>end</code> that represents a booking on the half-open interval <code>[start, end)</code>, the range of real numbers <code>x</code> such that <code>start<= x <end</code>.</p>
27
+
<p>The event can be represented as a pair of integers <code>startTime</code> and <code>endTime</code> that represents a booking on the half-open interval <code>[startTime, endTime)</code>, the range of real numbers <code>x</code> such that <code>startTime<= x <endTime</code>.</p>
28
28
29
29
<p>Implement the <code>MyCalendar</code> class:</p>
30
30
31
31
<ul>
32
32
<li><code>MyCalendar()</code> Initializes the calendar object.</li>
33
-
<li><code>boolean book(int start, int end)</code> Returns <code>true</code> if the event can be added to the calendar successfully without causing a <strong>double booking</strong>. Otherwise, return <code>false</code> and do not add the event to the calendar.</li>
33
+
<li><code>boolean book(int startTime, int endTime)</code> Returns <code>true</code> if the event can be added to the calendar successfully without causing a <strong>double booking</strong>. Otherwise, return <code>false</code> and do not add the event to the calendar.</li>
Copy file name to clipboardExpand all lines: solution/0700-0799/0731.My Calendar II/README_EN.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,13 @@ tags:
25
25
26
26
<p>A <strong>triple booking</strong> happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).</p>
27
27
28
-
<p>The event can be represented as a pair of integers <code>start</code> and <code>end</code> that represents a booking on the half-open interval <code>[start, end)</code>, the range of real numbers <code>x</code> such that <code>start<= x <end</code>.</p>
28
+
<p>The event can be represented as a pair of integers <code>startTime</code> and <code>endTime</code> that represents a booking on the half-open interval <code>[startTime, endTime)</code>, the range of real numbers <code>x</code> such that <code>startTime<= x <endTime</code>.</p>
29
29
30
30
<p>Implement the <code>MyCalendarTwo</code> class:</p>
31
31
32
32
<ul>
33
33
<li><code>MyCalendarTwo()</code> Initializes the calendar object.</li>
34
-
<li><code>boolean book(int start, int end)</code> Returns <code>true</code> if the event can be added to the calendar successfully without causing a <strong>triple booking</strong>. Otherwise, return <code>false</code> and do not add the event to the calendar.</li>
34
+
<li><code>boolean book(int startTime, int endTime)</code> Returns <code>true</code> if the event can be added to the calendar successfully without causing a <strong>triple booking</strong>. Otherwise, return <code>false</code> and do not add the event to the calendar.</li>
<li>Otherwise, <strong>remove</strong> the edge between <code>x</code> and its current parent and make node <code>y</code> the new parent of <code>x</code> by adding an edge between them.</li>
27
33
</ul>
28
34
29
-
<p>Return an array <code>answer</code> of size <code>n</code> where <code>answer[i]</code> is the <strong>size</strong> of the subtree rooted at node <code>i</code> in the <strong>final</strong> tree.</p>
30
-
31
-
<p>A <strong>subtree</strong> of <code>treeName</code> is a tree consisting of a node in <code>treeName</code> and all of its descendants.</p>
35
+
<p>Return an array <code>answer</code> of size <code>n</code> where <code>answer[i]</code> is the <strong>size</strong> of the <spandata-keyword="subtree">subtree</span> rooted at node <code>i</code> in the <strong>final</strong> tree.</p>
<p>Return the <strong>maximum factor score</strong> of <code>nums</code> after removing <strong>at most</strong> one element from it.</p>
22
26
23
-
<p><strong>Note</strong> that <em>both</em> the LCM and GCD of a single number are the number itself, and the <em>factor score</em> of an <strong>empty</strong> array is 0.</p>
24
-
25
-
<p>The term <code>lcm(a, b)</code> denotes the <strong>least common multiple</strong> of <code>a</code> and <code>b</code>.</p>
26
-
27
-
<p>The term <code>gcd(a, b)</code> denotes the <strong>greatest common divisor</strong> of <code>a</code> and <code>b</code>.</p>
27
+
<p><strong>Note</strong> that <em>both</em> the <spandata-keyword="lcm-function">LCM</span> and <spandata-keyword="gcd-function">GCD</span> of a single number are the number itself, and the <em>factor score</em> of an <strong>empty</strong> array is 0.</p>
<p>You are given an integer array <code>nums</code>.</p>
18
23
19
-
<p>Your task is to find the number of pairs of <strong>non-empty</strong> subsequences <code>(seq1, seq2)</code> of <code>nums</code> that satisfy the following conditions:</p>
24
+
<p>Your task is to find the number of pairs of <strong>non-empty</strong> <spandata-keyword="subsequence-array">subsequences</span> <code>(seq1, seq2)</code> of <code>nums</code> that satisfy the following conditions:</p>
20
25
21
26
<ul>
22
27
<li>The subsequences <code>seq1</code> and <code>seq2</code> are <strong>disjoint</strong>, meaning <strong>no index</strong> of <code>nums</code> is common between them.</li>
23
-
<li>The GCD of the elements of <code>seq1</code> is equal to the GCD of the elements of <code>seq2</code>.</li>
28
+
<li>The <span data-keyword="gcd-function">GCD</span> of the elements of <code>seq1</code> is equal to the GCD of the elements of <code>seq2</code>.</li>
24
29
</ul>
25
30
26
31
<p>Return the total number of such pairs.</p>
27
32
28
33
<p>Since the answer may be very large, return it <strong>modulo</strong> <code>10<sup>9</sup> + 7</code>.</p>
29
34
30
-
<p>The term <code>gcd(a, b)</code> denotes the <strong>greatest common divisor</strong> of <code>a</code> and <code>b</code>.</p>
31
-
32
-
<p>A <strong>subsequence</strong> is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.</p>
| 3327 | [Check if DFS Strings Are Palindromes](/solution/3300-3399/3327.Check%20if%20DFS%20Strings%20Are%20Palindromes/README_EN.md) | `Tree`,`Depth-First Search`,`Array`,`Hash Table`,`String`,`Hash Function` | Hard | Weekly Contest 420 |
3339
3339
| 3328 | [Find Cities in Each State II](/solution/3300-3399/3328.Find%20Cities%20in%20Each%20State%20II/README_EN.md) | `Database` | Medium | 🔒 |
3340
3340
| 3329 | [Count Substrings With K-Frequency Characters II](/solution/3300-3399/3329.Count%20Substrings%20With%20K-Frequency%20Characters%20II/README_EN.md) | `Hash Table`,`String`,`Sliding Window` | Hard | 🔒 |
3341
-
| 3330 | [Find the Original Typed String I](/solution/3300-3399/3330.Find%20the%20Original%20Typed%20String%20I/README_EN.md) | | Easy | Biweekly Contest 142 |
3342
-
| 3331 | [Find Subtree Sizes After Changes](/solution/3300-3399/3331.Find%20Subtree%20Sizes%20After%20Changes/README_EN.md) | | Medium | Biweekly Contest 142 |
3343
-
| 3332 | [Maximum Points Tourist Can Earn](/solution/3300-3399/3332.Maximum%20Points%20Tourist%20Can%20Earn/README_EN.md) | | Medium | Biweekly Contest 142 |
3344
-
| 3333 | [Find the Original Typed String II](/solution/3300-3399/3333.Find%20the%20Original%20Typed%20String%20II/README_EN.md) | | Hard | Biweekly Contest 142 |
3345
-
| 3334 | [Find the Maximum Factor Score of Array](/solution/3300-3399/3334.Find%20the%20Maximum%20Factor%20Score%20of%20Array/README_EN.md) | | Medium | Weekly Contest 421 |
3346
-
| 3335 | [Total Characters in String After Transformations I](/solution/3300-3399/3335.Total%20Characters%20in%20String%20After%20Transformations%20I/README_EN.md) | | Medium | Weekly Contest 421 |
3347
-
| 3336 | [Find the Number of Subsequences With Equal GCD](/solution/3300-3399/3336.Find%20the%20Number%20of%20Subsequences%20With%20Equal%20GCD/README_EN.md) | | Hard | Weekly Contest 421 |
3348
-
| 3337 | [Total Characters in String After Transformations II](/solution/3300-3399/3337.Total%20Characters%20in%20String%20After%20Transformations%20II/README_EN.md) | | Hard | Weekly Contest 421 |
3341
+
| 3330 | [Find the Original Typed String I](/solution/3300-3399/3330.Find%20the%20Original%20Typed%20String%20I/README_EN.md) | `String` | Easy | Biweekly Contest 142 |
3342
+
| 3331 | [Find Subtree Sizes After Changes](/solution/3300-3399/3331.Find%20Subtree%20Sizes%20After%20Changes/README_EN.md) | `Tree`,`Depth-First Search`,`Array`,`Hash Table`,`String` | Medium | Biweekly Contest 142 |
3343
+
| 3332 | [Maximum Points Tourist Can Earn](/solution/3300-3399/3332.Maximum%20Points%20Tourist%20Can%20Earn/README_EN.md) | `Array`,`Dynamic Programming`,`Matrix` | Medium | Biweekly Contest 142 |
3344
+
| 3333 | [Find the Original Typed String II](/solution/3300-3399/3333.Find%20the%20Original%20Typed%20String%20II/README_EN.md) | `String`,`Dynamic Programming`,`Prefix Sum` | Hard | Biweekly Contest 142 |
3345
+
| 3334 | [Find the Maximum Factor Score of Array](/solution/3300-3399/3334.Find%20the%20Maximum%20Factor%20Score%20of%20Array/README_EN.md) | `Array`,`Math`,`Number Theory` | Medium | Weekly Contest 421 |
3346
+
| 3335 | [Total Characters in String After Transformations I](/solution/3300-3399/3335.Total%20Characters%20in%20String%20After%20Transformations%20I/README_EN.md) | `Hash Table`,`Math`,`String`,`Dynamic Programming`,`Counting` | Medium | Weekly Contest 421 |
3347
+
| 3336 | [Find the Number of Subsequences With Equal GCD](/solution/3300-3399/3336.Find%20the%20Number%20of%20Subsequences%20With%20Equal%20GCD/README_EN.md) | `Array`,`Math`,`Dynamic Programming`,`Number Theory` | Hard | Weekly Contest 421 |
3348
+
| 3337 | [Total Characters in String After Transformations II](/solution/3300-3399/3337.Total%20Characters%20in%20String%20After%20Transformations%20II/README_EN.md) | `Hash Table`,`Math`,`String`,`Dynamic Programming`,`Counting` | Hard | Weekly Contest 421 |
0 commit comments