File tree Expand file tree Collapse file tree 5 files changed +45
-11
lines changed
src/main/java/com/diguage/algo/leetcode Expand file tree Collapse file tree 5 files changed +45
-11
lines changed Original file line number Diff line number Diff line change @@ -5597,14 +5597,14 @@ TIP: **公众号的微信号是: `jikerizhi`**。__因为众所周知的原因
5597
5597
//|{doc_base_url}/0795-number-of-subarrays-with-bounded-maximum.adoc[题解]
5598
5598
//|Medium
5599
5599
//|
5600
- //
5601
- // |{counter:codes}
5602
- // |{leetcode_base_url}/rotate-string/[796. Rotate String^]
5603
- // |{source_base_url}/_0796_RotateString.java[Java]
5604
- // |{doc_base_url}/0796-rotate-string.adoc[题解]
5605
- // |Easy
5606
- // |
5607
- //
5600
+
5601
+ |{counter:codes}
5602
+ |{leetcode_base_url}/rotate-string/[796. Rotate String^]
5603
+ |{source_base_url}/_0796_RotateString.java[Java]
5604
+ |{doc_base_url}/0796-rotate-string.adoc[题解]
5605
+ |Easy
5606
+ |
5607
+
5608
5608
//|{counter:codes}
5609
5609
//|{leetcode_base_url}/all-paths-from-source-to-target/[797. All Paths From Source to Target^]
5610
5610
//|{source_base_url}/_0797_AllPathsFromSourceToTarget.java[Java]
Original file line number Diff line number Diff line change @@ -23,12 +23,26 @@ A _shift on `A`_ consists of taking string `A` and moving the leftmost character
23
23
24
24
* `A` and `B` will have length at most `100` .
25
25
26
-
27
-
26
+ == 思路分析
28
27
29
28
[[src-0796]]
29
+ ====
30
+ 一刷::
31
+ +
32
+ --
30
33
[{java_src_attr}]
31
34
----
32
35
include::{sourcedir}/_0796_RotateString.java[tag=answer]
33
36
----
37
+ --
38
+
39
+ // 二刷::
40
+ // +
41
+ // --
42
+ // [{java_src_attr}]
43
+ // ----
44
+ // include::{sourcedir}/_0796_RotateString_2.java[tag=answer]
45
+ // ----
46
+ // --
47
+ ====
34
48
Original file line number Diff line number Diff line change @@ -1666,7 +1666,7 @@ include::0768-max-chunks-to-make-sorted-ii.adoc[leveloffset=+1]
1666
1666
1667
1667
// include::0795-number-of-subarrays-with-bounded-maximum.adoc[leveloffset=+1]
1668
1668
1669
- // include::0796-rotate-string.adoc[leveloffset=+1]
1669
+ include::0796-rotate-string.adoc[leveloffset=+1]
1670
1670
1671
1671
// include::0797-all-paths-from-source-to-target.adoc[leveloffset=+1]
1672
1672
Original file line number Diff line number Diff line change 838
838
|{doc_base_url} /0003-longest-substring-without-repeating-characters.adoc[题解]
839
839
|✅ 滑动窗口。滑动窗口的模板不是很熟悉。可以不存字符格式,存字符最大的坐标。
840
840
841
+ |{counter:codes}
842
+ |{leetcode_base_url} /rotate-string/[796. Rotate String^]
843
+ |{doc_base_url} /0796-rotate-string.adoc[题解]
844
+ |✅
845
+
846
+
841
847
|===
842
848
843
849
截止目前,本轮练习一共完成 {codes} 道题。
Original file line number Diff line number Diff line change
1
+ package com .diguage .algo .leetcode ;
2
+
3
+ public class _0796_RotateString {
4
+ // tag::answer[]
5
+ /**
6
+ * @author D瓜哥 · https://www.diguage.com
7
+ * @since 2024-09-21 20:48:24
8
+ */
9
+ public boolean rotateString (String s , String goal ) {
10
+ return (s .length () == goal .length ())
11
+ && ((s + s ).contains (goal ));
12
+ }
13
+ // end::answer[]
14
+ }
You can’t perform that action at this time.
0 commit comments