From b8bff289f89cad45996b532a5241e6250a540c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Fri, 15 Sep 2023 09:37:12 +0000 Subject: [PATCH 1/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202209040078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040078/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040078/.keep diff --git a/2209040078/.keep b/2209040078/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From d7be1a234022714966c7e21164e641802861399c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Fri, 15 Sep 2023 09:37:51 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20chapter1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040078/chapter1/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2209040078/chapter1/.keep diff --git a/2209040078/chapter1/.keep b/2209040078/chapter1/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 8606f361e67ec4feec88bb1b22a2ed63d4267ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Fri, 15 Sep 2023 09:38:49 +0000 Subject: [PATCH 3/9] =?UTF-8?q?add=202209040078/chapter1/=E4=B8=A4?= =?UTF-8?q?=E6=95=B0=E4=B9=8B=E5=92=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 干喝火锅 <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> --- ...44\270\244\346\225\260\344\271\213\345\222\214" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" diff --git "a/2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" "b/2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" new file mode 100644 index 00000000..747e054f --- /dev/null +++ "b/2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" @@ -0,0 +1,14 @@ +class Solution { +public: + vector twoSum(vector& nums, int target) { + unordered_map hash; + for (int i = 0; i < nums.size(); ++i) + { + if (hash.find(target - nums[i]) != hash.end()) + return { hash[target - nums[i]],i }; + else + hash[nums[i]] = i; + } + return {}; +} +}; \ No newline at end of file -- Gitee From 78fa4cabca77c1011f0bf1727ba1e11eedd91bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sat, 16 Sep 2023 05:37:19 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=202209?= =?UTF-8?q?040078/chapter1/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040078/chapter1/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040078/chapter1/.keep diff --git a/2209040078/chapter1/.keep b/2209040078/chapter1/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From 5ced1a3791d3b27b2e5c2a37964d19a8535e438d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sat, 16 Sep 2023 05:37:45 +0000 Subject: [PATCH 5/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=A5=87=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E7=9A=84=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" diff --git "a/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" "b/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From 1a7f763ef98808ffb301d6c576605c866c605aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sat, 16 Sep 2023 05:38:58 +0000 Subject: [PATCH 6/9] =?UTF-8?q?rename=202209040078/chapter1/=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=A5=87=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E7=9A=84=E5=92=8C/.keep=20to=202209040078/chapter1/?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=A5=87=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E7=9A=84=E5=92=8C/=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=A5=87=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E7=9A=84=E5=92=8C.=202209040078=20=E6=9D=8E=E4=BF=8A=E5=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 干喝火锅 <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> --- .../.keep" | 0 ...\225\260\347\273\204\347\232\204\345\222\214" | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) delete mode 100644 "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" create mode 100644 "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" diff --git "a/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" "b/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/.keep" deleted file mode 100644 index e69de29b..00000000 diff --git "a/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" "b/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" new file mode 100644 index 00000000..e3a789ea --- /dev/null +++ "b/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" @@ -0,0 +1,16 @@ +class Solution { +public: + int sumOddLengthSubarrays(vector& arr) { + int sum = 0; + int n = arr.size(); + for (int start = 0; start < n; start++) { + for (int length = 1; start + length <= n; length += 2) { + int end = start + length - 1; + for (int i = start; i <= end; i++) { + sum += arr[i]; + } + } + } + return sum; + } +}; \ No newline at end of file -- Gitee From 1845f549624a679abf51918288b062d41a5df561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sat, 16 Sep 2023 05:41:43 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=202209?= =?UTF-8?q?040078/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2209040078/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2209040078/.keep diff --git a/2209040078/.keep b/2209040078/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From fbfcee4dc739617d6d21b479626f171f565c8148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sun, 17 Sep 2023 01:51:13 +0000 Subject: [PATCH 8/9] =?UTF-8?q?update=20=202209040078/chapter1/=E4=B8=A4?= =?UTF-8?q?=E6=95=B0=E4=B9=8B=E5=92=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 干喝火锅 <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> --- .../\344\270\244\346\225\260\344\271\213\345\222\214.cpp" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" => "2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" (100%) diff --git "a/2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" "b/2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" similarity index 100% rename from "2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214" rename to "2209040078/chapter1/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" -- Gitee From c66cb06fe8e2a79400a8a5647986523c94ad900c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B2=E5=96=9D=E7=81=AB=E9=94=85?= <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> Date: Sun, 17 Sep 2023 01:54:29 +0000 Subject: [PATCH 9/9] =?UTF-8?q?update=20=202209040078/chapter1/=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=A5=87=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E7=9A=84=E5=92=8C/=E6=89=80=E6=9C=89=E5=A5=87?= =?UTF-8?q?=E6=95=B0=E9=95=BF=E5=BA=A6=E5=AD=90=E6=95=B0=E7=BB=84=E7=9A=84?= =?UTF-8?q?=E5=92=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 干喝火锅 <13419790+dry-drinking-hot-pot@user.noreply.gitee.com> --- ...5\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" => "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" (100%) diff --git "a/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" "b/2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" similarity index 100% rename from "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214" rename to "2209040078/chapter1/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214/\346\211\200\346\234\211\345\245\207\346\225\260\351\225\277\345\272\246\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214.cpp" -- Gitee