From ba8533638ba3d15ab5c963ef2ce2d4ce69deac7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:19:27 +0000 Subject: [PATCH 01/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20chapter=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/chapter 6/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/chapter 6/.keep diff --git a/2209040080/chapter 6/.keep b/2209040080/chapter 6/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 895936b842d935de7158bb2b2c2a4a046797634f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:48:04 +0000 Subject: [PATCH 02/18] =?UTF-8?q?add=202209040080/chapter=206/lc=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E8=BF=9E=E7=BB=AD=201=20=E7=9A=84=E4=B8=AA=E6=95=B0.c?= =?UTF-8?q?pp..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 帅气的张林 <3534286757@qq.com> --- ...\347\232\204\344\270\252\346\225\260.cpp." | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "2209040080/chapter 6/lc\346\234\200\345\244\247\350\277\236\347\273\255 1 \347\232\204\344\270\252\346\225\260.cpp." diff --git "a/2209040080/chapter 6/lc\346\234\200\345\244\247\350\277\236\347\273\255 1 \347\232\204\344\270\252\346\225\260.cpp." "b/2209040080/chapter 6/lc\346\234\200\345\244\247\350\277\236\347\273\255 1 \347\232\204\344\270\252\346\225\260.cpp." new file mode 100644 index 00000000..f4faa551 --- /dev/null +++ "b/2209040080/chapter 6/lc\346\234\200\345\244\247\350\277\236\347\273\255 1 \347\232\204\344\270\252\346\225\260.cpp." @@ -0,0 +1,19 @@ +class Solution { +public: + int findMaxConsecutiveOnes(vector& nums) { +int max = 0; + int count = 0; + for (int num : nums) { + if (num == 1) { + count++; + } else { + if (max < count) { + max = count; + } + count = 0; + } + } + return count > max ? count : max; + + } +}; \ No newline at end of file -- Gitee From f07b6fce902e9bc30515ed095d1f4946a89f6a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:48:25 +0000 Subject: [PATCH 03/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20sdada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/sdada/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/sdada/.keep diff --git a/2209040080/sdada/.keep b/2209040080/sdada/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 62edbbc3405d7db102ab1afca5c3775d9af5e657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:48:36 +0000 Subject: [PATCH 04/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/sdada/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/sdada/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/sdada/.keep diff --git a/2209040080/sdada/.keep b/2209040080/sdada/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From e66810cf8e06b56b5b67c271528bf39411d2ac15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:48:54 +0000 Subject: [PATCH 05/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20cahpter=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 7/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/cahpter 7/.keep diff --git a/2209040080/cahpter 7/.keep b/2209040080/cahpter 7/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From e9fc9638b45f15b5d69f0101a7fdd7d7bf804006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:49:06 +0000 Subject: [PATCH 06/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/cahpter=207/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 7/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/cahpter 7/.keep diff --git a/2209040080/cahpter 7/.keep b/2209040080/cahpter 7/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From 438b127b0d67980e5d93a9ccd08faa6c8f74bd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:49:29 +0000 Subject: [PATCH 07/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20fwfwf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/fwfwf/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/fwfwf/.keep diff --git a/2209040080/fwfwf/.keep b/2209040080/fwfwf/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 0e4c9f0469c0f8de10e6068c73f94a5c2ddcd79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:49:42 +0000 Subject: [PATCH 08/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/fwfwf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/fwfwf/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/fwfwf/.keep diff --git a/2209040080/fwfwf/.keep b/2209040080/fwfwf/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From d84c8a48df1e12140d212d82e0446531fd02d6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:49:52 +0000 Subject: [PATCH 09/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20chapter=206f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/chapter 6f/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/chapter 6f/.keep diff --git a/2209040080/chapter 6f/.keep b/2209040080/chapter 6f/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 61ede833591b164ddc09e7c9273a56e1646d1f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:01 +0000 Subject: [PATCH 10/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/chapter=206f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/chapter 6f/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/chapter 6f/.keep diff --git a/2209040080/chapter 6f/.keep b/2209040080/chapter 6f/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From d95bc7b0d628c7d10346e77cc333b203fa7a1333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:11 +0000 Subject: [PATCH 11/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20cahpter=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 7/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/cahpter 7/.keep diff --git a/2209040080/cahpter 7/.keep b/2209040080/cahpter 7/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 9058378f744d7cad947ebd38b3f02680c9829a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:23 +0000 Subject: [PATCH 12/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20cahpter=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 8/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040080/cahpter 8/.keep diff --git a/2209040080/cahpter 8/.keep b/2209040080/cahpter 8/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From f18320f561b90a6918a786a83de5e4a978fa0f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:31 +0000 Subject: [PATCH 13/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/cahpter=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 8/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/cahpter 8/.keep diff --git a/2209040080/cahpter 8/.keep b/2209040080/cahpter 8/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From 466261134476c69cdb6b14c42e99c72f7e4efbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:37 +0000 Subject: [PATCH 14/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/cahpter=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/cahpter 7/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/cahpter 7/.keep diff --git a/2209040080/cahpter 7/.keep b/2209040080/cahpter 7/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From b56d3a513267a246854c7983008779ad86fea1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 09:50:48 +0000 Subject: [PATCH 15/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2022?= =?UTF-8?q?09040080/chapter=206/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040080/chapter 6/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040080/chapter 6/.keep diff --git a/2209040080/chapter 6/.keep b/2209040080/chapter 6/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From b574b99c5aedb1b13d3cb450652d2951a724ef57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 13:11:01 +0000 Subject: [PATCH 16/18] =?UTF-8?q?add=202209040080/chapter=203/lc=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E8=AE=A1=E7=AE=97=E6=9C=BA2.cpp..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 帅气的张林 <3534286757@qq.com> --- ...350\256\241\347\256\227\346\234\2722.cpp." | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "2209040080/chapter 3/lc\345\237\272\346\234\254\350\256\241\347\256\227\346\234\2722.cpp." diff --git "a/2209040080/chapter 3/lc\345\237\272\346\234\254\350\256\241\347\256\227\346\234\2722.cpp." "b/2209040080/chapter 3/lc\345\237\272\346\234\254\350\256\241\347\256\227\346\234\2722.cpp." new file mode 100644 index 00000000..0e61e3f1 --- /dev/null +++ "b/2209040080/chapter 3/lc\345\237\272\346\234\254\350\256\241\347\256\227\346\234\2722.cpp." @@ -0,0 +1,21 @@ +class Solution { +public: + int calculate(string s) { + int n = s.size(),dgt=0; + char preSign='+';//第一个数是正的 + vector v; + for(int i=0; i Date: Sat, 23 Dec 2023 13:15:01 +0000 Subject: [PATCH 17/18] =?UTF-8?q?add=202209040080/chapter=203/lc=E7=94=A8?= =?UTF-8?q?=E9=98=9F=E5=88=97=E5=AE=9E=E7=8E=B0=E6=A0=88.cpp..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 帅气的张林 <3534286757@qq.com> --- ...\345\256\236\347\216\260\346\240\210.cpp." | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "2209040080/chapter 3/lc\347\224\250\351\230\237\345\210\227\345\256\236\347\216\260\346\240\210.cpp." diff --git "a/2209040080/chapter 3/lc\347\224\250\351\230\237\345\210\227\345\256\236\347\216\260\346\240\210.cpp." "b/2209040080/chapter 3/lc\347\224\250\351\230\237\345\210\227\345\256\236\347\216\260\346\240\210.cpp." new file mode 100644 index 00000000..1ca6e3c7 --- /dev/null +++ "b/2209040080/chapter 3/lc\347\224\250\351\230\237\345\210\227\345\256\236\347\216\260\346\240\210.cpp." @@ -0,0 +1,30 @@ +class MyStack { +public: + queue a; + queue b; + MyStack() { + + } + + void push(int x) { + b.push(x); + swap(a,b); + while(b.size()){ + a.push(b.front());b.pop(); + } + } + + int pop() { + int res = a.front(); + a.pop(); + return res; + } + + int top() { + return a.front(); + } + + bool empty() { + return a.empty(); + } +}; \ No newline at end of file -- Gitee From 971e927a1ca76b497b0e33daf09f832f836ba343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E6=B0=94=E7=9A=84=E5=BC=A0=E6=9E=97?= <3534286757@qq.com> Date: Sat, 23 Dec 2023 13:19:40 +0000 Subject: [PATCH 18/18] =?UTF-8?q?add=202209040080/chapter=203/lc=E9=80=86?= =?UTF-8?q?=E6=B3=A2=E5=85=B0=E8=A1=A8=E8=BE=BE=E5=BC=8F=E6=B1=82=E5=80=BC?= =?UTF-8?q?.cpp..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 帅气的张林 <3534286757@qq.com> --- ...\345\274\217\346\261\202\345\200\274.cpp." | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 "2209040080/chapter 3/lc\351\200\206\346\263\242\345\205\260\350\241\250\350\276\276\345\274\217\346\261\202\345\200\274.cpp." diff --git "a/2209040080/chapter 3/lc\351\200\206\346\263\242\345\205\260\350\241\250\350\276\276\345\274\217\346\261\202\345\200\274.cpp." "b/2209040080/chapter 3/lc\351\200\206\346\263\242\345\205\260\350\241\250\350\276\276\345\274\217\346\261\202\345\200\274.cpp." new file mode 100644 index 00000000..f49b0fba --- /dev/null +++ "b/2209040080/chapter 3/lc\351\200\206\346\263\242\345\205\260\350\241\250\350\276\276\345\274\217\346\261\202\345\200\274.cpp." @@ -0,0 +1,32 @@ +class Solution { +public: + int evalRPN(vector& tokens) { + stack st; + for (string s : tokens) { + if (s == "+") { + int a = st.top(); st.pop(); + int b = st.top(); st.pop(); + st.push(a+b); + } + else if (s == "-") { + int a = st.top(); st.pop(); + int b = st.top(); st.pop(); + st.push(b-a); + } + else if (s == "*") { + int a = st.top(); st.pop(); + int b = st.top(); st.pop(); + st.push(a*b); + } + else if (s == "/") { + int a = st.top(); st.pop(); + int b = st.top(); st.pop(); + st.push(b/a); + } + else { + st.push(stoi(s)); + } + } + return st.top(); + } +}; \ No newline at end of file -- Gitee