From 78dffff25f1d245572f40ee01740ed594a7663e2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 2 Apr 2023 01:00:22 +0000 Subject: [PATCH 01/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/02- Successful Pairs of Spells and Potions/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/02- Successful Pairs of Spells and Potions/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 76565d691..e15948fab 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -369,6 +369,10 @@ { "day": "01", "title": "Binary Search" + }, + { + "day": "02", + "title": "Successful Pairs of Spells and Potions" } ] } \ No newline at end of file diff --git a/04- April/02- Successful Pairs of Spells and Potions/.gitkeep b/04- April/02- Successful Pairs of Spells and Potions/.gitkeep new file mode 100644 index 000000000..e69de29bb From 770f46897ab43cfc51660182488bbe86dbbd9709 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 3 Apr 2023 00:56:27 +0000 Subject: [PATCH 02/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/03- Boats to Save People/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/03- Boats to Save People/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index e15948fab..908b97009 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -373,6 +373,10 @@ { "day": "02", "title": "Successful Pairs of Spells and Potions" + }, + { + "day": "03", + "title": "Boats to Save People" } ] } \ No newline at end of file diff --git a/04- April/03- Boats to Save People/.gitkeep b/04- April/03- Boats to Save People/.gitkeep new file mode 100644 index 000000000..e69de29bb From fb665cf3aaf170d13ea14a54a12ed148b8ab6eca Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 4 Apr 2023 00:58:21 +0000 Subject: [PATCH 03/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/04- Optimal Partition of String/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/04- Optimal Partition of String/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 908b97009..62b0291cd 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -377,6 +377,10 @@ { "day": "03", "title": "Boats to Save People" + }, + { + "day": "04", + "title": "Optimal Partition of String" } ] } \ No newline at end of file diff --git a/04- April/04- Optimal Partition of String/.gitkeep b/04- April/04- Optimal Partition of String/.gitkeep new file mode 100644 index 000000000..e69de29bb From 9efe430262ecf5d1185f9421448b8e595ab561a5 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 5 Apr 2023 00:37:37 +0000 Subject: [PATCH 04/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/05- Minimize Maximum of Array/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/05- Minimize Maximum of Array/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 62b0291cd..f5eb34389 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -381,6 +381,10 @@ { "day": "04", "title": "Optimal Partition of String" + }, + { + "day": "05", + "title": "Minimize Maximum of Array" } ] } \ No newline at end of file diff --git a/04- April/05- Minimize Maximum of Array/.gitkeep b/04- April/05- Minimize Maximum of Array/.gitkeep new file mode 100644 index 000000000..e69de29bb From 0945e14a5bfa76b9046aed264de2bfaf7ec40111 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 5 Apr 2023 00:54:48 +0000 Subject: [PATCH 05/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/05- Minimize Maximum of Array/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/05- Minimize Maximum of Array/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 62b0291cd..f5eb34389 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -381,6 +381,10 @@ { "day": "04", "title": "Optimal Partition of String" + }, + { + "day": "05", + "title": "Minimize Maximum of Array" } ] } \ No newline at end of file diff --git a/04- April/05- Minimize Maximum of Array/.gitkeep b/04- April/05- Minimize Maximum of Array/.gitkeep new file mode 100644 index 000000000..e69de29bb From 27558dfdf148ff5236d09f131b605b24fb2de855 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 6 Apr 2023 00:25:40 +0000 Subject: [PATCH 06/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/06- Number of Closed Islands/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/06- Number of Closed Islands/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index f5eb34389..d1dadc2ff 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -385,6 +385,10 @@ { "day": "05", "title": "Minimize Maximum of Array" + }, + { + "day": "06", + "title": "Number of Closed Islands" } ] } \ No newline at end of file diff --git a/04- April/06- Number of Closed Islands/.gitkeep b/04- April/06- Number of Closed Islands/.gitkeep new file mode 100644 index 000000000..e69de29bb From 9249213069b6baa1cf7e24b15d469b733431ae0c Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 6 Apr 2023 00:39:38 +0000 Subject: [PATCH 07/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/06- Number of Closed Islands/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/06- Number of Closed Islands/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index f5eb34389..d1dadc2ff 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -385,6 +385,10 @@ { "day": "05", "title": "Minimize Maximum of Array" + }, + { + "day": "06", + "title": "Number of Closed Islands" } ] } \ No newline at end of file diff --git a/04- April/06- Number of Closed Islands/.gitkeep b/04- April/06- Number of Closed Islands/.gitkeep new file mode 100644 index 000000000..e69de29bb From 5708dbd58b0355df777e036aba4e662e2ff9a612 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 7 Apr 2023 00:50:10 +0000 Subject: [PATCH 08/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/07- Number of Enclaves/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/07- Number of Enclaves/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index d1dadc2ff..9ac7cca10 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -389,6 +389,10 @@ { "day": "06", "title": "Number of Closed Islands" + }, + { + "day": "07", + "title": "Number of Enclaves" } ] } \ No newline at end of file diff --git a/04- April/07- Number of Enclaves/.gitkeep b/04- April/07- Number of Enclaves/.gitkeep new file mode 100644 index 000000000..e69de29bb From ab635b778dccd6f686155eb4083cb43edcde7d1b Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 7 Apr 2023 00:59:52 +0000 Subject: [PATCH 09/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/07- Number of Enclaves/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/07- Number of Enclaves/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index d1dadc2ff..9ac7cca10 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -389,6 +389,10 @@ { "day": "06", "title": "Number of Closed Islands" + }, + { + "day": "07", + "title": "Number of Enclaves" } ] } \ No newline at end of file diff --git a/04- April/07- Number of Enclaves/.gitkeep b/04- April/07- Number of Enclaves/.gitkeep new file mode 100644 index 000000000..e69de29bb From 846b5143486c5e2978ff1e42f582fc79fe35765a Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 8 Apr 2023 00:38:25 +0000 Subject: [PATCH 10/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/08- Clone Graph/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/08- Clone Graph/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 9ac7cca10..07ac9b02c 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -393,6 +393,10 @@ { "day": "07", "title": "Number of Enclaves" + }, + { + "day": "08", + "title": "Clone Graph" } ] } \ No newline at end of file diff --git a/04- April/08- Clone Graph/.gitkeep b/04- April/08- Clone Graph/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4aab366a393244cad07e2d2140aa6f6bf64e53eb Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 8 Apr 2023 00:53:09 +0000 Subject: [PATCH 11/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/08- Clone Graph/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/08- Clone Graph/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 9ac7cca10..07ac9b02c 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -393,6 +393,10 @@ { "day": "07", "title": "Number of Enclaves" + }, + { + "day": "08", + "title": "Clone Graph" } ] } \ No newline at end of file diff --git a/04- April/08- Clone Graph/.gitkeep b/04- April/08- Clone Graph/.gitkeep new file mode 100644 index 000000000..e69de29bb From 61c1139347b74b8d2f2fd8fa0beca4c6e41b3d5c Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 9 Apr 2023 00:39:03 +0000 Subject: [PATCH 12/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../09- Largest Color Value in a Directed Graph/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/09- Largest Color Value in a Directed Graph/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 07ac9b02c..39f3dc096 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -397,6 +397,10 @@ { "day": "08", "title": "Clone Graph" + }, + { + "day": "09", + "title": "Largest Color Value in a Directed Graph" } ] } \ No newline at end of file diff --git a/04- April/09- Largest Color Value in a Directed Graph/.gitkeep b/04- April/09- Largest Color Value in a Directed Graph/.gitkeep new file mode 100644 index 000000000..e69de29bb From 1fc887c8b990c75b4ae0ea8513738d73bb886159 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 9 Apr 2023 00:56:12 +0000 Subject: [PATCH 13/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../09- Largest Color Value in a Directed Graph/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/09- Largest Color Value in a Directed Graph/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 07ac9b02c..39f3dc096 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -397,6 +397,10 @@ { "day": "08", "title": "Clone Graph" + }, + { + "day": "09", + "title": "Largest Color Value in a Directed Graph" } ] } \ No newline at end of file diff --git a/04- April/09- Largest Color Value in a Directed Graph/.gitkeep b/04- April/09- Largest Color Value in a Directed Graph/.gitkeep new file mode 100644 index 000000000..e69de29bb From fa9ecfbdb7870a138d4842ef549fdb458eeffdb8 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 10 Apr 2023 00:39:11 +0000 Subject: [PATCH 14/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/10- Valid Parentheses/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/10- Valid Parentheses/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 39f3dc096..cedda9375 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -401,6 +401,10 @@ { "day": "09", "title": "Largest Color Value in a Directed Graph" + }, + { + "day": "10", + "title": "Valid Parentheses" } ] } \ No newline at end of file diff --git a/04- April/10- Valid Parentheses/.gitkeep b/04- April/10- Valid Parentheses/.gitkeep new file mode 100644 index 000000000..e69de29bb From a49968f22ebf96c700906fe419da48236fd7b247 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 10 Apr 2023 00:56:25 +0000 Subject: [PATCH 15/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/10- Valid Parentheses/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/10- Valid Parentheses/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 39f3dc096..cedda9375 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -401,6 +401,10 @@ { "day": "09", "title": "Largest Color Value in a Directed Graph" + }, + { + "day": "10", + "title": "Valid Parentheses" } ] } \ No newline at end of file diff --git a/04- April/10- Valid Parentheses/.gitkeep b/04- April/10- Valid Parentheses/.gitkeep new file mode 100644 index 000000000..e69de29bb From f9aef97403a3b0fbe578518e2f9208a0bfbbcf96 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 11 Apr 2023 00:55:49 +0000 Subject: [PATCH 16/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/11- Removing Stars From a String/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/11- Removing Stars From a String/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cedda9375..8428a4643 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -405,6 +405,10 @@ { "day": "10", "title": "Valid Parentheses" + }, + { + "day": "11", + "title": "Removing Stars From a String" } ] } \ No newline at end of file diff --git a/04- April/11- Removing Stars From a String/.gitkeep b/04- April/11- Removing Stars From a String/.gitkeep new file mode 100644 index 000000000..e69de29bb From afd7bb89a30f7301c1c4875e7d3b1635f5900834 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 11 Apr 2023 01:02:50 +0000 Subject: [PATCH 17/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/11- Removing Stars From a String/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/11- Removing Stars From a String/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cedda9375..8428a4643 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -405,6 +405,10 @@ { "day": "10", "title": "Valid Parentheses" + }, + { + "day": "11", + "title": "Removing Stars From a String" } ] } \ No newline at end of file diff --git a/04- April/11- Removing Stars From a String/.gitkeep b/04- April/11- Removing Stars From a String/.gitkeep new file mode 100644 index 000000000..e69de29bb From 0129c4a7a3bdae4c582dbf35d7ec018518f41085 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 12 Apr 2023 00:49:53 +0000 Subject: [PATCH 18/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/12- Simplify Path/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/12- Simplify Path/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 8428a4643..cc047b5e9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -409,6 +409,10 @@ { "day": "11", "title": "Removing Stars From a String" + }, + { + "day": "12", + "title": "Simplify Path" } ] } \ No newline at end of file diff --git a/04- April/12- Simplify Path/.gitkeep b/04- April/12- Simplify Path/.gitkeep new file mode 100644 index 000000000..e69de29bb From 912ef8487a512b33ea159a5b982562f849a34e2c Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 12 Apr 2023 01:02:39 +0000 Subject: [PATCH 19/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/12- Simplify Path/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/12- Simplify Path/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 8428a4643..cc047b5e9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -409,6 +409,10 @@ { "day": "11", "title": "Removing Stars From a String" + }, + { + "day": "12", + "title": "Simplify Path" } ] } \ No newline at end of file diff --git a/04- April/12- Simplify Path/.gitkeep b/04- April/12- Simplify Path/.gitkeep new file mode 100644 index 000000000..e69de29bb From eaa34041603ecdba653d04f4c74df1b9bf0607b2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 13 Apr 2023 00:47:20 +0000 Subject: [PATCH 20/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/13- Validate Stack Sequences/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/13- Validate Stack Sequences/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cc047b5e9..d1adac8cc 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -413,6 +413,10 @@ { "day": "12", "title": "Simplify Path" + }, + { + "day": "13", + "title": "Validate Stack Sequences" } ] } \ No newline at end of file diff --git a/04- April/13- Validate Stack Sequences/.gitkeep b/04- April/13- Validate Stack Sequences/.gitkeep new file mode 100644 index 000000000..e69de29bb From 142f8a4b06d0931bd8b693574359d29b2e6fa0f4 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 13 Apr 2023 00:59:43 +0000 Subject: [PATCH 21/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/13- Validate Stack Sequences/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/13- Validate Stack Sequences/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cc047b5e9..d1adac8cc 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -413,6 +413,10 @@ { "day": "12", "title": "Simplify Path" + }, + { + "day": "13", + "title": "Validate Stack Sequences" } ] } \ No newline at end of file diff --git a/04- April/13- Validate Stack Sequences/.gitkeep b/04- April/13- Validate Stack Sequences/.gitkeep new file mode 100644 index 000000000..e69de29bb From 521406b9ca981f8e3c59fb7ce2e8129adce4e7eb Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 14 Apr 2023 00:56:14 +0000 Subject: [PATCH 22/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/14- Longest Palindromic Subsequence/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/14- Longest Palindromic Subsequence/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index d1adac8cc..cfe997942 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -417,6 +417,10 @@ { "day": "13", "title": "Validate Stack Sequences" + }, + { + "day": "14", + "title": "Longest Palindromic Subsequence" } ] } \ No newline at end of file diff --git a/04- April/14- Longest Palindromic Subsequence/.gitkeep b/04- April/14- Longest Palindromic Subsequence/.gitkeep new file mode 100644 index 000000000..e69de29bb From cf24d1a543c089bb90d2fbb463b9b1094fff28f2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 14 Apr 2023 01:07:58 +0000 Subject: [PATCH 23/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/14- Longest Palindromic Subsequence/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/14- Longest Palindromic Subsequence/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index d1adac8cc..cfe997942 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -417,6 +417,10 @@ { "day": "13", "title": "Validate Stack Sequences" + }, + { + "day": "14", + "title": "Longest Palindromic Subsequence" } ] } \ No newline at end of file diff --git a/04- April/14- Longest Palindromic Subsequence/.gitkeep b/04- April/14- Longest Palindromic Subsequence/.gitkeep new file mode 100644 index 000000000..e69de29bb From e53805495f026b954200d5374e5d604e5baaa588 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 15 Apr 2023 00:49:28 +0000 Subject: [PATCH 24/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/15- Maximum Value of K Coins From Piles/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/15- Maximum Value of K Coins From Piles/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cfe997942..6b1f35006 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -421,6 +421,10 @@ { "day": "14", "title": "Longest Palindromic Subsequence" + }, + { + "day": "15", + "title": "Maximum Value of K Coins From Piles" } ] } \ No newline at end of file diff --git a/04- April/15- Maximum Value of K Coins From Piles/.gitkeep b/04- April/15- Maximum Value of K Coins From Piles/.gitkeep new file mode 100644 index 000000000..e69de29bb From d8d2530fa2de2d3ba9136a2af15fbf8c105e48a4 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 15 Apr 2023 01:01:09 +0000 Subject: [PATCH 25/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/15- Maximum Value of K Coins From Piles/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/15- Maximum Value of K Coins From Piles/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index cfe997942..6b1f35006 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -421,6 +421,10 @@ { "day": "14", "title": "Longest Palindromic Subsequence" + }, + { + "day": "15", + "title": "Maximum Value of K Coins From Piles" } ] } \ No newline at end of file diff --git a/04- April/15- Maximum Value of K Coins From Piles/.gitkeep b/04- April/15- Maximum Value of K Coins From Piles/.gitkeep new file mode 100644 index 000000000..e69de29bb From 256a775f4b491aa2bb70a26ef0f7f00f3e947052 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 16 Apr 2023 00:51:00 +0000 Subject: [PATCH 26/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 6b1f35006..fbfe5ad13 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -425,6 +425,10 @@ { "day": "15", "title": "Maximum Value of K Coins From Piles" + }, + { + "day": "16", + "title": "Number of Ways to Form a Target String Given a Dictionary" } ] } \ No newline at end of file diff --git a/04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep b/04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep new file mode 100644 index 000000000..e69de29bb From c8d0bd62d11b21620dc2b2208f914554c78b1de6 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 16 Apr 2023 01:01:58 +0000 Subject: [PATCH 27/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 6b1f35006..fbfe5ad13 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -425,6 +425,10 @@ { "day": "15", "title": "Maximum Value of K Coins From Piles" + }, + { + "day": "16", + "title": "Number of Ways to Form a Target String Given a Dictionary" } ] } \ No newline at end of file diff --git a/04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep b/04- April/16- Number of Ways to Form a Target String Given a Dictionary/.gitkeep new file mode 100644 index 000000000..e69de29bb From 5a35975cbfc6e9022b20ef056677c35a5ed3c781 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 17 Apr 2023 00:47:28 +0000 Subject: [PATCH 28/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../17- Kids With the Greatest Number of Candies/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/17- Kids With the Greatest Number of Candies/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index fbfe5ad13..7cc53c103 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -429,6 +429,10 @@ { "day": "16", "title": "Number of Ways to Form a Target String Given a Dictionary" + }, + { + "day": "17", + "title": "Kids With the Greatest Number of Candies" } ] } \ No newline at end of file diff --git a/04- April/17- Kids With the Greatest Number of Candies/.gitkeep b/04- April/17- Kids With the Greatest Number of Candies/.gitkeep new file mode 100644 index 000000000..e69de29bb From 6a064927611d8a5fa72ac3031fad3929be641989 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 17 Apr 2023 00:58:14 +0000 Subject: [PATCH 29/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../17- Kids With the Greatest Number of Candies/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/17- Kids With the Greatest Number of Candies/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index fbfe5ad13..7cc53c103 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -429,6 +429,10 @@ { "day": "16", "title": "Number of Ways to Form a Target String Given a Dictionary" + }, + { + "day": "17", + "title": "Kids With the Greatest Number of Candies" } ] } \ No newline at end of file diff --git a/04- April/17- Kids With the Greatest Number of Candies/.gitkeep b/04- April/17- Kids With the Greatest Number of Candies/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4c434ccf0b047c20a576000361fa7908c560c1b0 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 18 Apr 2023 00:51:48 +0000 Subject: [PATCH 30/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/18- Merge Strings Alternately/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/18- Merge Strings Alternately/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 7cc53c103..c51ee9860 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -433,6 +433,10 @@ { "day": "17", "title": "Kids With the Greatest Number of Candies" + }, + { + "day": "18", + "title": "Merge Strings Alternately" } ] } \ No newline at end of file diff --git a/04- April/18- Merge Strings Alternately/.gitkeep b/04- April/18- Merge Strings Alternately/.gitkeep new file mode 100644 index 000000000..e69de29bb From 1f61102ed26aa79c09a8181392c20e741094bb6e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 18 Apr 2023 01:05:42 +0000 Subject: [PATCH 31/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/18- Merge Strings Alternately/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/18- Merge Strings Alternately/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 7cc53c103..c51ee9860 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -433,6 +433,10 @@ { "day": "17", "title": "Kids With the Greatest Number of Candies" + }, + { + "day": "18", + "title": "Merge Strings Alternately" } ] } \ No newline at end of file diff --git a/04- April/18- Merge Strings Alternately/.gitkeep b/04- April/18- Merge Strings Alternately/.gitkeep new file mode 100644 index 000000000..e69de29bb From 23ee5c93a8b514c8c61b6d34b9463fc83f0b1fbf Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 19 Apr 2023 00:45:33 +0000 Subject: [PATCH 32/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index c51ee9860..e4093c389 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -437,6 +437,10 @@ { "day": "18", "title": "Merge Strings Alternately" + }, + { + "day": "19", + "title": "Longest ZigZag Path in a Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep b/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4b391a997734f153a8b435b3d50af2674875f851 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 19 Apr 2023 01:02:55 +0000 Subject: [PATCH 33/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index c51ee9860..e4093c389 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -437,6 +437,10 @@ { "day": "18", "title": "Merge Strings Alternately" + }, + { + "day": "19", + "title": "Longest ZigZag Path in a Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep b/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From a8f207225fbf07b72f799224014eef114e77a5fc Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 19 Apr 2023 01:08:13 +0000 Subject: [PATCH 34/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index c51ee9860..e4093c389 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -437,6 +437,10 @@ { "day": "18", "title": "Merge Strings Alternately" + }, + { + "day": "19", + "title": "Longest ZigZag Path in a Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep b/04- April/19- Longest ZigZag Path in a Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From 8adf1cddcd113e9f89e8ba1b3f69d1effaff60b2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 20 Apr 2023 00:44:13 +0000 Subject: [PATCH 35/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/20- Maximum Width of Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/20- Maximum Width of Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index e4093c389..1187d5bf9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -441,6 +441,10 @@ { "day": "19", "title": "Longest ZigZag Path in a Binary Tree" + }, + { + "day": "20", + "title": "Maximum Width of Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/20- Maximum Width of Binary Tree/.gitkeep b/04- April/20- Maximum Width of Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From 5e696b5376d889f216c9a04bb82d12be78ba2f70 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 20 Apr 2023 00:57:31 +0000 Subject: [PATCH 36/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/20- Maximum Width of Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/20- Maximum Width of Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index e4093c389..1187d5bf9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -441,6 +441,10 @@ { "day": "19", "title": "Longest ZigZag Path in a Binary Tree" + }, + { + "day": "20", + "title": "Maximum Width of Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/20- Maximum Width of Binary Tree/.gitkeep b/04- April/20- Maximum Width of Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From 6aeaf4698f8f2afcb4d3eac767b8811eef63e0b5 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 20 Apr 2023 01:05:05 +0000 Subject: [PATCH 37/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/20- Maximum Width of Binary Tree/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/20- Maximum Width of Binary Tree/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index e4093c389..1187d5bf9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -441,6 +441,10 @@ { "day": "19", "title": "Longest ZigZag Path in a Binary Tree" + }, + { + "day": "20", + "title": "Maximum Width of Binary Tree" } ] } \ No newline at end of file diff --git a/04- April/20- Maximum Width of Binary Tree/.gitkeep b/04- April/20- Maximum Width of Binary Tree/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4b218c9d1901754e3ad3dcb41f2535d0d3def69b Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 21 Apr 2023 00:45:18 +0000 Subject: [PATCH 38/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/21- Profitable Schemes/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/21- Profitable Schemes/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1187d5bf9..4d8eb0687 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -445,6 +445,10 @@ { "day": "20", "title": "Maximum Width of Binary Tree" + }, + { + "day": "21", + "title": "Profitable Schemes" } ] } \ No newline at end of file diff --git a/04- April/21- Profitable Schemes/.gitkeep b/04- April/21- Profitable Schemes/.gitkeep new file mode 100644 index 000000000..e69de29bb From cc9497ff69c2c334f8a236671866b0ef169476a2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 21 Apr 2023 01:01:34 +0000 Subject: [PATCH 39/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/21- Profitable Schemes/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/21- Profitable Schemes/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1187d5bf9..4d8eb0687 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -445,6 +445,10 @@ { "day": "20", "title": "Maximum Width of Binary Tree" + }, + { + "day": "21", + "title": "Profitable Schemes" } ] } \ No newline at end of file diff --git a/04- April/21- Profitable Schemes/.gitkeep b/04- April/21- Profitable Schemes/.gitkeep new file mode 100644 index 000000000..e69de29bb From 5611cf91d96152ab493c09b9882a5f4353d2f9a0 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 21 Apr 2023 01:07:50 +0000 Subject: [PATCH 40/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/21- Profitable Schemes/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/21- Profitable Schemes/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1187d5bf9..4d8eb0687 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -445,6 +445,10 @@ { "day": "20", "title": "Maximum Width of Binary Tree" + }, + { + "day": "21", + "title": "Profitable Schemes" } ] } \ No newline at end of file diff --git a/04- April/21- Profitable Schemes/.gitkeep b/04- April/21- Profitable Schemes/.gitkeep new file mode 100644 index 000000000..e69de29bb From 53f3744700f6e8efceea386dafedd6ab23addac7 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 22 Apr 2023 00:40:25 +0000 Subject: [PATCH 41/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 4d8eb0687..ba0270155 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -449,6 +449,10 @@ { "day": "21", "title": "Profitable Schemes" + }, + { + "day": "22", + "title": "Minimum Insertion Steps to Make a String Palindrome" } ] } \ No newline at end of file diff --git a/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep b/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep new file mode 100644 index 000000000..e69de29bb From 93fd589a9b697a12849ac89908b1d314baf47a6d Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 22 Apr 2023 00:50:19 +0000 Subject: [PATCH 42/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 4d8eb0687..ba0270155 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -449,6 +449,10 @@ { "day": "21", "title": "Profitable Schemes" + }, + { + "day": "22", + "title": "Minimum Insertion Steps to Make a String Palindrome" } ] } \ No newline at end of file diff --git a/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep b/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4f02f85d0db7995b2a1c345ae1e21079524187d2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 22 Apr 2023 01:01:39 +0000 Subject: [PATCH 43/69] Add new daily problem --- .github/data/problems.json | 4 ++++ .../.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 4d8eb0687..ba0270155 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -449,6 +449,10 @@ { "day": "21", "title": "Profitable Schemes" + }, + { + "day": "22", + "title": "Minimum Insertion Steps to Make a String Palindrome" } ] } \ No newline at end of file diff --git a/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep b/04- April/22- Minimum Insertion Steps to Make a String Palindrome/.gitkeep new file mode 100644 index 000000000..e69de29bb From d70d15a939c31d87fa23fa168d39c678d7c2fb94 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 23 Apr 2023 00:39:06 +0000 Subject: [PATCH 44/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/23- Restore The Array/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/23- Restore The Array/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index ba0270155..6a4bf97cd 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -453,6 +453,10 @@ { "day": "22", "title": "Minimum Insertion Steps to Make a String Palindrome" + }, + { + "day": "23", + "title": "Restore The Array" } ] } \ No newline at end of file diff --git a/04- April/23- Restore The Array/.gitkeep b/04- April/23- Restore The Array/.gitkeep new file mode 100644 index 000000000..e69de29bb From 26d86aa864b855fe8ad58658d55a996fa7dd5f5e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 23 Apr 2023 00:56:28 +0000 Subject: [PATCH 45/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/23- Restore The Array/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/23- Restore The Array/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index ba0270155..6a4bf97cd 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -453,6 +453,10 @@ { "day": "22", "title": "Minimum Insertion Steps to Make a String Palindrome" + }, + { + "day": "23", + "title": "Restore The Array" } ] } \ No newline at end of file diff --git a/04- April/23- Restore The Array/.gitkeep b/04- April/23- Restore The Array/.gitkeep new file mode 100644 index 000000000..e69de29bb From e864de771ea0a93c1261f41ea807c7ca7bedf41e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 23 Apr 2023 01:07:11 +0000 Subject: [PATCH 46/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/23- Restore The Array/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/23- Restore The Array/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index ba0270155..6a4bf97cd 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -453,6 +453,10 @@ { "day": "22", "title": "Minimum Insertion Steps to Make a String Palindrome" + }, + { + "day": "23", + "title": "Restore The Array" } ] } \ No newline at end of file diff --git a/04- April/23- Restore The Array/.gitkeep b/04- April/23- Restore The Array/.gitkeep new file mode 100644 index 000000000..e69de29bb From 7c238ed1e868d18d7243ed9cc51760cf9fd20578 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 24 Apr 2023 00:34:05 +0000 Subject: [PATCH 47/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/24- Last Stone Weight/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/24- Last Stone Weight/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 6a4bf97cd..89687db92 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -457,6 +457,10 @@ { "day": "23", "title": "Restore The Array" + }, + { + "day": "24", + "title": "Last Stone Weight" } ] } \ No newline at end of file diff --git a/04- April/24- Last Stone Weight/.gitkeep b/04- April/24- Last Stone Weight/.gitkeep new file mode 100644 index 000000000..e69de29bb From c3749727280ce7b3968474a49c70f0761e1ba477 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 24 Apr 2023 00:47:07 +0000 Subject: [PATCH 48/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/24- Last Stone Weight/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/24- Last Stone Weight/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 6a4bf97cd..89687db92 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -457,6 +457,10 @@ { "day": "23", "title": "Restore The Array" + }, + { + "day": "24", + "title": "Last Stone Weight" } ] } \ No newline at end of file diff --git a/04- April/24- Last Stone Weight/.gitkeep b/04- April/24- Last Stone Weight/.gitkeep new file mode 100644 index 000000000..e69de29bb From bd2d01da79bb8d5d2171facb12d1202906070128 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 24 Apr 2023 01:03:30 +0000 Subject: [PATCH 49/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/24- Last Stone Weight/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/24- Last Stone Weight/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 6a4bf97cd..89687db92 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -457,6 +457,10 @@ { "day": "23", "title": "Restore The Array" + }, + { + "day": "24", + "title": "Last Stone Weight" } ] } \ No newline at end of file diff --git a/04- April/24- Last Stone Weight/.gitkeep b/04- April/24- Last Stone Weight/.gitkeep new file mode 100644 index 000000000..e69de29bb From 767353a46db2a34a1a900506df3bd502b639ad68 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 00:44:50 +0000 Subject: [PATCH 50/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/25- Smallest Number in Infinite Set/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 89687db92..2514d4950 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -461,6 +461,10 @@ { "day": "24", "title": "Last Stone Weight" + }, + { + "day": "25", + "title": "Smallest Number in Infinite Set" } ] } \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/.gitkeep b/04- April/25- Smallest Number in Infinite Set/.gitkeep new file mode 100644 index 000000000..e69de29bb From c1c2e1a3962db389e5df394c1ec7caae97fdbfb7 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 01:00:11 +0000 Subject: [PATCH 51/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/25- Smallest Number in Infinite Set/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 89687db92..2514d4950 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -461,6 +461,10 @@ { "day": "24", "title": "Last Stone Weight" + }, + { + "day": "25", + "title": "Smallest Number in Infinite Set" } ] } \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/.gitkeep b/04- April/25- Smallest Number in Infinite Set/.gitkeep new file mode 100644 index 000000000..e69de29bb From 8c187b5fb937a2473e5697bbc7de404f33c2d6b7 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 01:02:33 +0000 Subject: [PATCH 52/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/25- Smallest Number in Infinite Set/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 89687db92..2514d4950 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -461,6 +461,10 @@ { "day": "24", "title": "Last Stone Weight" + }, + { + "day": "25", + "title": "Smallest Number in Infinite Set" } ] } \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/.gitkeep b/04- April/25- Smallest Number in Infinite Set/.gitkeep new file mode 100644 index 000000000..e69de29bb From 28f5f4bcf902e0c1b8b7ffbd791547824631f92e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 01:06:26 +0000 Subject: [PATCH 53/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/25- Smallest Number in Infinite Set/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 89687db92..2514d4950 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -461,6 +461,10 @@ { "day": "24", "title": "Last Stone Weight" + }, + { + "day": "25", + "title": "Smallest Number in Infinite Set" } ] } \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/.gitkeep b/04- April/25- Smallest Number in Infinite Set/.gitkeep new file mode 100644 index 000000000..e69de29bb From c9e785a49265af3a2ad6fe7784d867143d122d5e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 01:37:07 +0000 Subject: [PATCH 54/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/25- Smallest Number in Infinite Set/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 89687db92..2514d4950 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -461,6 +461,10 @@ { "day": "24", "title": "Last Stone Weight" + }, + { + "day": "25", + "title": "Smallest Number in Infinite Set" } ] } \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/.gitkeep b/04- April/25- Smallest Number in Infinite Set/.gitkeep new file mode 100644 index 000000000..e69de29bb From 6ca960271de491e2d4723fa630dc6181d29115ed Mon Sep 17 00:00:00 2001 From: Ibrahim Khaild <103538501+Hima-khalid@users.noreply.github.com> Date: Tue, 25 Apr 2023 03:44:59 +0200 Subject: [PATCH 55/69] 25- Smallest Number in Infinite Set --- ...umber in Infinite Set (Ibrahim Khalid).cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ibrahim Khalid).cpp diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ibrahim Khalid).cpp b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ibrahim Khalid).cpp new file mode 100644 index 000000000..f1a194b78 --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ibrahim Khalid).cpp @@ -0,0 +1,40 @@ +// author : ibrahim khalid +class SmallestInfiniteSet { +public: + // create set to store number 1 from 1000 +sets; + // create value increase by 1 +int n; + SmallestInfiniteSet() { + // Initial value equal 1 + n=1; + } + + int popSmallest() { + SmallestInfiniteSet(); + // add n + s.insert(n); + // increae to store after pop small element + n++; + // x equal smallest element + int x=* s.begin(); + // pop + s.erase(x); + return x; + + } + + void addBack(int num) { + // if num less than or equal to n --> store in set + if(num<=n){ + s.insert(num); + } + } +}; + +/** + * Your SmallestInfiniteSet object will be instantiated and called as such: + * SmallestInfiniteSet* obj = new SmallestInfiniteSet(); + * int param_1 = obj->popSmallest(); + * obj->addBack(num); + */ From bebde37ec1493fbf14e6f9d214c64ae9cadb66f7 Mon Sep 17 00:00:00 2001 From: Omar wael <63034210+omar2818@users.noreply.github.com> Date: Tue, 25 Apr 2023 09:27:44 +0200 Subject: [PATCH 56/69] 25- Smallest Number in Infinite Set (Omar Wael).cpp --- ...est Number in Infinite Set (Omar Wael).cpp | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Omar Wael).cpp diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Omar Wael).cpp b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Omar Wael).cpp new file mode 100644 index 000000000..304606500 --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Omar Wael).cpp @@ -0,0 +1,45 @@ +// Author : Omar Wael +// leetcode account : https://leetcode.com/OmarWael1/ + +class SmallestInfiniteSet { +public: + int ans=1; + priority_queue,greater>pq; + int vis[1005]; + SmallestInfiniteSet() { + // min number is 1 + ans=1; + // visit all numbers + for(int i=1;i<=1004;i++){ + vis[i]=1; + } + } + int popSmallest() { + // if there is number less than the ans + // then unvisit it and return it + if(!pq.empty() && pq.top()popSmallest(); + * obj->addBack(num); + */ From 8ef596bffabf0b66ef0cdfcd8a0305da3ce730ac Mon Sep 17 00:00:00 2001 From: Osama Ayman Date: Tue, 25 Apr 2023 13:19:39 +0200 Subject: [PATCH 57/69] Added my sol to 25 April --- ... Number in Infinite Set (Osama Ayman).java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Osama Ayman).java diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Osama Ayman).java b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Osama Ayman).java new file mode 100644 index 000000000..acf88aa9e --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Osama Ayman).java @@ -0,0 +1,47 @@ +// Author: Osama Ayman +// Time: O((m+n) log(n)) +// Space: O(n) +class SmallestInfiniteSet { + // use a priority queue to keep track of the added integers in increasing order + // we will only add numbers that are less than the current number + PriorityQueue addedIntegers; + // set to tell if a number is already in the pq, so we don't add it again to the pq + Set set; + // represents the lowest number in the infinte set + int cur; + public SmallestInfiniteSet() { + addedIntegers = new PriorityQueue<>(); + set = new HashSet<>(); + // initially set to 1 + cur = 1; + } + + public int popSmallest() { + // if pq is empty then the lowest number is the cur + if(addedIntegers.isEmpty()){ + // return it, then increment it by 1 + return cur++; + } + // else if pq not empty, then the top number in it is lower than the cur + int pop = addedIntegers.poll(); + // remove it from set as we removed it from pq + set.remove(pop); + return pop; + } + + public void addBack(int num) { + // if the pq already contains the num or the num is greater than or equal to + // cur, dont add it + if(set.contains(num) || cur <= num) return; + // else add it + set.add(num); + addedIntegers.add(num); + } +} + +/** + * Your SmallestInfiniteSet object will be instantiated and called as such: + * SmallestInfiniteSet obj = new SmallestInfiniteSet(); + * int param_1 = obj.popSmallest(); + * obj.addBack(num); + */ \ No newline at end of file From 6756d5063822ae4082965bbf6e74b93d820c21dc Mon Sep 17 00:00:00 2001 From: aboelsoud Date: Tue, 25 Apr 2023 15:20:33 +0200 Subject: [PATCH 58/69] add the 25'th day problem solution --- ...er in Infinite Set (Mahmoud Aboelsoud).cpp | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Mahmoud Aboelsoud).cpp diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Mahmoud Aboelsoud).cpp b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Mahmoud Aboelsoud).cpp new file mode 100644 index 000000000..28576f228 --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Mahmoud Aboelsoud).cpp @@ -0,0 +1,48 @@ +// Author: Mahmoud Aboelsoud + +class SmallestInfiniteSet { +public: + // we need to find the smallest number in the set and remove it + // we start the set with all numbers from 1 to 1000 + // we can use a vector to represent the set + // we can use a variable to keep track of the smallest number in the set + // when we pop the smallest number we go to the next number in the set + // when we add a number back to the set we check if it is smaller than the smallest number in the set + // if it is we update the smallest number in the set + + // vis: vector to represent the set + // vis[i] = 1 means that the number i is in the set + // vis[i] = 0 means that the number i is not in the set + vector vis; + // idx: the smallest number in the set + int idx; + SmallestInfiniteSet() { + // initialize the set with all numbers from 1 to 1000 + vis.assign(1001, 1); + // initialize the smallest number in the set to 1 + idx = 1; + } + + int popSmallest() { + // find the smallest number in the set + while(!vis[idx]) idx++; + // remove the smallest number from the set + vis[idx] = 0; + // return the smallest number + return idx++; + } + + void addBack(int num) { + // add the number to the set + vis[num] = 1; + // update the smallest number in the set + idx = min(idx, num); + } +}; + +/** + * Your SmallestInfiniteSet object will be instantiated and called as such: + * SmallestInfiniteSet* obj = new SmallestInfiniteSet(); + * int param_1 = obj->popSmallest(); + * obj->addBack(num); + */ From f56bc9f0c00c902acbf4d94d0ece5a89ec483f7f Mon Sep 17 00:00:00 2001 From: Ahmed Hossam <63050133+7oSkaaa@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:26:20 +0200 Subject: [PATCH 59/69] Create 25- Smallest Number in Infinite Set (Ahmed Hossam).cpp --- ... Number in Infinite Set (Ahmed Hossam).cpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ahmed Hossam).cpp diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ahmed Hossam).cpp b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ahmed Hossam).cpp new file mode 100644 index 000000000..eef85b1be --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Ahmed Hossam).cpp @@ -0,0 +1,35 @@ +// Author: Ahmed Hossam + +class SmallestInfiniteSet { +public: + // Define a set variable named Mex + set < int > Mex; + + // Define a constant integer N with a value of 1000 + static constexpr int N = 1000; + + // Constructor function for the SmallestInfiniteSet class + SmallestInfiniteSet() { + // Loop through integers from 1 to N and insert them into the set variable Mex + for(int i = 1; i <= N; i++) + Mex.insert(i); + } + + // Function to remove and return the smallest integer from the set variable Mex + int popSmallest() { + // Store the smallest integer in the set variable Mex + int mex = *Mex.begin(); + + // Remove the smallest integer from the set variable Mex + Mex.erase(Mex.begin()); + + // Return the smallest integer + return mex; + } + + // Function to add an integer back to the set variable Mex + void addBack(int num) { + // Insert the integer into the set variable Mex + Mex.insert(num); + } +}; From 488c4cb1811a7aa51889064a2614cd025e9153b5 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 15:27:06 +0000 Subject: [PATCH 60/69] Add new daily problem to README --- 04- April/README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/04- April/README.md b/04- April/README.md index a653315a6..a725e9c21 100644 --- a/04- April/README.md +++ b/04- April/README.md @@ -47,6 +47,7 @@ 1. **[Minimum Insertion Steps to Make a String Palindrome](#22--minimum-insertion-steps-to-make-a-string-palindrome)** 1. **[Restore The Array](#23--restore-the-array)** 1. **[Last Stone Weight](#24--last-stone-weight)** +1. **[Smallest Number in Infinite Set](#25--smallest-number-in-infinite-set)**


@@ -1399,4 +1400,56 @@ public: } }; ``` + +
+

+ +## 25) [Smallest Number in Infinite Set](https://leetcode.com/problems/smallest-number-in-infinite-set/) + +### Difficulty + +![](https://img.shields.io/badge/Medium-orange?style=for-the-badge) + +### Related Topic + +`Hash Table` `Design` `Heap (Priority Queue)` + +### Code + + +```cpp +class SmallestInfiniteSet { +public: + // Define a set variable named Mex + set < int > Mex; + + // Define a constant integer N with a value of 1000 + static constexpr int N = 1000; + + // Constructor function for the SmallestInfiniteSet class + SmallestInfiniteSet() { + // Loop through integers from 1 to N and insert them into the set variable Mex + for(int i = 1; i <= N; i++) + Mex.insert(i); + } + + // Function to remove and return the smallest integer from the set variable Mex + int popSmallest() { + // Store the smallest integer in the set variable Mex + int mex = *Mex.begin(); + + // Remove the smallest integer from the set variable Mex + Mex.erase(Mex.begin()); + + // Return the smallest integer + return mex; + } + + // Function to add an integer back to the set variable Mex + void addBack(int num) { + // Insert the integer into the set variable Mex + Mex.insert(num); + } +}; +``` \ No newline at end of file From 522b0df186fe8c471846a2f39f3dbe2ce4a382d3 Mon Sep 17 00:00:00 2001 From: Noura Algohary Date: Wed, 26 Apr 2023 01:58:49 +0200 Subject: [PATCH 61/69] add day 25 challenge --- ...umber in Infinite Set (Noura Algohary).cpp | 32 +++++++++++++++++++ ...Number in Infinite Set (Noura Algohary).py | 31 ++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).cpp create mode 100644 04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).py diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).cpp b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).cpp new file mode 100644 index 000000000..b0cc0211d --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).cpp @@ -0,0 +1,32 @@ +//Author: Noura Algohary + +class SmallestInfiniteSet { +public: + // set is used to store UNIQUE values in ascending order by default + setst; + SmallestInfiniteSet() { + st.clear(); + + for(int i = 1; i<=1000;i++) + st.insert(i); + } + + int popSmallest() { + // smallest element is at the beginning of the set + int removed = *st.begin(); + st.erase(st.begin()); + + return removed; + } + + void addBack(int num) { + st.insert(num); + } +}; + +/** + * Your SmallestInfiniteSet object will be instantiated and called as such: + * SmallestInfiniteSet* obj = new SmallestInfiniteSet(); + * int param_1 = obj->popSmallest(); + * obj->addBack(num); + */ \ No newline at end of file diff --git a/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).py b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).py new file mode 100644 index 000000000..b30fa7d77 --- /dev/null +++ b/04- April/25- Smallest Number in Infinite Set/25- Smallest Number in Infinite Set (Noura Algohary).py @@ -0,0 +1,31 @@ +# Author: Noura Algohary +class SmallestInfiniteSet: + # use list as a set + st = [] + + def __init__(self): + self.st.clear() + + for i in range(1, 1001): + self.st.append(i) + + + def popSmallest(self) -> int: + # sort to return the first element(smallest element) + self.st.sort() + + removed = self.st.pop(0) + + return removed + + def addBack(self, num: int) -> None: + # make sure the number is not presented in the set + if num not in self.st: + self.st.insert(0, num) + + + +# Your SmallestInfiniteSet object will be instantiated and called as such: +# obj = SmallestInfiniteSet() +# param_1 = obj.popSmallest() +# obj.addBack(num) \ No newline at end of file From 98f7f9ebce36a925f43e4e5e260cd53c8d0e7fd3 Mon Sep 17 00:00:00 2001 From: aboelsoud Date: Wed, 26 Apr 2023 02:05:40 +0200 Subject: [PATCH 62/69] add the 26'th day problem solution --- .../26- Add Digits(Mahmoud Aboelsoud).cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp diff --git a/04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp b/04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp new file mode 100644 index 000000000..212846526 --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp @@ -0,0 +1,29 @@ +// Author: Mahmoud Aboelsoud + +class Solution { +public: + // in this problem we have to add the digits of a number until we get a single digit + // we can do this by using a while loop and a nested while loop + // the outer loop will run until the number is less than 9 + // the inner loop will run until the number is 0 to add the digits + + int addDigits(int num) { + // loop until the number is less than or equal 9 (single digit) + while(num > 9){ + // x: the sum of the digits + int x = 0; + // loop until the number is 0 to add the digits + while(num){ + // add the last digit to x + x += num % 10; + // remove the last digit from the number + num /= 10; + } + // make the number equal to x (the sum of the digits) + num = x; + } + + // return the number + return num; + } +}; From 0137c5584ef1cb385c9b20262bd93e3bed54092c Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 00:34:38 +0000 Subject: [PATCH 63/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/26- Add Digits/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/26- Add Digits/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 2514d4950..1174ac2c5 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -465,6 +465,10 @@ { "day": "25", "title": "Smallest Number in Infinite Set" + }, + { + "day": "26", + "title": "Add Digits" } ] } \ No newline at end of file diff --git a/04- April/26- Add Digits/.gitkeep b/04- April/26- Add Digits/.gitkeep new file mode 100644 index 000000000..e69de29bb From 48b090dbb6b3ed8d413b996be41659d4fb900da5 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 00:59:16 +0000 Subject: [PATCH 64/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/26- Add Digits/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/26- Add Digits/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 2514d4950..1174ac2c5 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -465,6 +465,10 @@ { "day": "25", "title": "Smallest Number in Infinite Set" + }, + { + "day": "26", + "title": "Add Digits" } ] } \ No newline at end of file diff --git a/04- April/26- Add Digits/.gitkeep b/04- April/26- Add Digits/.gitkeep new file mode 100644 index 000000000..e69de29bb From 409f71f8311bd17ae606f0c713a8753e81692d0a Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 01:35:46 +0000 Subject: [PATCH 65/69] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/26- Add Digits/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/26- Add Digits/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 2514d4950..1174ac2c5 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -465,6 +465,10 @@ { "day": "25", "title": "Smallest Number in Infinite Set" + }, + { + "day": "26", + "title": "Add Digits" } ] } \ No newline at end of file diff --git a/04- April/26- Add Digits/.gitkeep b/04- April/26- Add Digits/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4a00408727ef627642349ad524dedbf933662710 Mon Sep 17 00:00:00 2001 From: Osama Ayman Date: Wed, 26 Apr 2023 12:43:00 +0200 Subject: [PATCH 66/69] Added my sol to 26 April --- .../26- Add Digits (Osama Ayman).java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits (Osama Ayman).java diff --git a/04- April/26- Add Digits/26- Add Digits (Osama Ayman).java b/04- April/26- Add Digits/26- Add Digits (Osama Ayman).java new file mode 100644 index 000000000..b78ec387d --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (Osama Ayman).java @@ -0,0 +1,17 @@ +// Author: Osama Ayman +class Solution { + public int addDigits(int num) { + // if it is a single digit return it + if(num <= 9) return num; + // else calculate the sum of digits + int res = 0; + while(num > 0){ + // get the last digit of num, add it to res + res += num%10; + // remove last digit of num + num /= 10; + } + // do it recursively + return addDigits(res); + } +} \ No newline at end of file From c7ce3014ab00ec95304f6df6cf425375589a170b Mon Sep 17 00:00:00 2001 From: Ahmed Hossam <63050133+7oSkaaa@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:33:10 +0200 Subject: [PATCH 67/69] Create 26- Add Digits (Ahmed Hossam).cpp --- .../26- Add Digits (Ahmed Hossam).cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits (Ahmed Hossam).cpp diff --git a/04- April/26- Add Digits/26- Add Digits (Ahmed Hossam).cpp b/04- April/26- Add Digits/26- Add Digits (Ahmed Hossam).cpp new file mode 100644 index 000000000..90998dc39 --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (Ahmed Hossam).cpp @@ -0,0 +1,29 @@ +// Author: Ahmed Hossam + +class Solution { +public: + + // A function to find the sum of digits of a given number + int sumDigits(int num){ + // Initialize the sum variable to zero + int sum = 0; + + // Convert the number to a string and iterate over each character + for(auto& c : to_string(num)) + // Subtract the ASCII value of '0' from the character and add it to the sum + sum += c - '0'; + + // Return the sum of digits + return sum; + } + + int addDigits(int num) { + // Repeat the process until the number is a single digit + while(num > 9) + // Sum the digits of the number + num = sumDigits(num); + + // Return the resulting single digit + return num; + } +}; From 5692b8b613470d74eed94d8acdd7fa9de64ee3ea Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 14:34:07 +0000 Subject: [PATCH 68/69] Add new daily problem to README --- 04- April/README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/04- April/README.md b/04- April/README.md index a725e9c21..c38621b74 100644 --- a/04- April/README.md +++ b/04- April/README.md @@ -48,6 +48,7 @@ 1. **[Restore The Array](#23--restore-the-array)** 1. **[Last Stone Weight](#24--last-stone-weight)** 1. **[Smallest Number in Infinite Set](#25--smallest-number-in-infinite-set)** +1. **[Add Digits](#26--add-digits)**


@@ -1452,4 +1453,50 @@ public: } }; ``` + +
+

+ +## 26) [Add Digits](https://leetcode.com/problems/add-digits/) + +### Difficulty + +![](https://img.shields.io/badge/Easy-green?style=for-the-badge) + +### Related Topic + +`Math` `Simulation` `Number Theory` + +### Code + + +```cpp +class Solution { +public: + + // A function to find the sum of digits of a given number + int sumDigits(int num){ + // Initialize the sum variable to zero + int sum = 0; + + // Convert the number to a string and iterate over each character + for(auto& c : to_string(num)) + // Subtract the ASCII value of '0' from the character and add it to the sum + sum += c - '0'; + + // Return the sum of digits + return sum; + } + + int addDigits(int num) { + // Repeat the process until the number is a single digit + while(num > 9) + // Sum the digits of the number + num = sumDigits(num); + + // Return the resulting single digit + return num; + } +}; +``` \ No newline at end of file From 06a7700289f0232897cc86e578154714f82bb1b8 Mon Sep 17 00:00:00 2001 From: Ahmed Hossam <63050133+7oSkaaa@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:35:39 +0200 Subject: [PATCH 69/69] Rename 26- Add Digits(Mahmoud Aboelsoud).cpp to 26- Add Digits (Mahmoud Aboelsoud).cpp --- ...moud Aboelsoud).cpp => 26- Add Digits (Mahmoud Aboelsoud).cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 04- April/26- Add Digits/{26- Add Digits(Mahmoud Aboelsoud).cpp => 26- Add Digits (Mahmoud Aboelsoud).cpp} (100%) diff --git a/04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp b/04- April/26- Add Digits/26- Add Digits (Mahmoud Aboelsoud).cpp similarity index 100% rename from 04- April/26- Add Digits/26- Add Digits(Mahmoud Aboelsoud).cpp rename to 04- April/26- Add Digits/26- Add Digits (Mahmoud Aboelsoud).cpp