From ae2b36dd9886615f38925b77b22fccfdcb97434e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 4 Apr 2023 01:18:20 +0000 Subject: [PATCH 01/33] 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 8798129b4790e20e9499bde23757beacaceb8edd Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 5 Apr 2023 01:02:59 +0000 Subject: [PATCH 02/33] 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 01777656475c35e9740c9c1b9f7e2071af34d5a9 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 6 Apr 2023 00:55:24 +0000 Subject: [PATCH 03/33] 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 6af51e1fa4a678b17b45b1a1341e6dd74672d6c9 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 7 Apr 2023 01:16:09 +0000 Subject: [PATCH 04/33] 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 523a5ef582b42a3b152caddc4e267f4152ba0c8f Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 8 Apr 2023 01:07:43 +0000 Subject: [PATCH 05/33] 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 a22a0517b5129b9d027c863574d34e357ffdbbe8 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 9 Apr 2023 01:12:37 +0000 Subject: [PATCH 06/33] 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 610f7101966f73adfcfde8039c8b77526bca9429 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 10 Apr 2023 01:06:27 +0000 Subject: [PATCH 07/33] 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 28d69a65fd4948319316518aa81a89a50e73c630 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 11 Apr 2023 01:16:50 +0000 Subject: [PATCH 08/33] 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 172a62730a2db16f62d1aca2baf7e338a21ad2c5 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 12 Apr 2023 01:18:39 +0000 Subject: [PATCH 09/33] 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 75b584ea3b3eef045cf59c3373236134b5831401 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 13 Apr 2023 01:12:46 +0000 Subject: [PATCH 10/33] 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 1fb71f825294f1fd1c07576cfda78880cad5a7af Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 14 Apr 2023 01:18:29 +0000 Subject: [PATCH 11/33] 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 119e3831ba8ef5979a455105a0f9eda937c1c256 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 15 Apr 2023 01:20:08 +0000 Subject: [PATCH 12/33] 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 2aede523fe2391a28abaecf5b7c701aa40990d55 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 16 Apr 2023 01:17:44 +0000 Subject: [PATCH 13/33] 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 911dcd2709c10c3b5bf9cb73ce6d3f4b49b7c3ff Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 17 Apr 2023 01:12:55 +0000 Subject: [PATCH 14/33] 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 95e3f64c08cd9a28c11e72ce9a2e5229d1681f8b Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 18 Apr 2023 01:21:05 +0000 Subject: [PATCH 15/33] 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 76e17b16af6dc1fd2a1c2700dd520a6228bf74a1 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 19 Apr 2023 01:20:51 +0000 Subject: [PATCH 16/33] 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 00f1de4a58937b3be77e6d27925b73d2794872d1 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 20 Apr 2023 01:17:24 +0000 Subject: [PATCH 17/33] 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 6f43f1661a4edcb9862f0c16a5416337d9f86c72 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Fri, 21 Apr 2023 01:19:31 +0000 Subject: [PATCH 18/33] 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 f6bf47bc32af131924aaca658604c0516dedb2e6 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sat, 22 Apr 2023 01:18:27 +0000 Subject: [PATCH 19/33] 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 1d24e3dd239d6dc62eb696c17948537c1d63d7a0 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Sun, 23 Apr 2023 01:23:39 +0000 Subject: [PATCH 20/33] 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 d551a19e1f6381b0b88bfff5c1c76fe9811a034a Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Mon, 24 Apr 2023 01:17:48 +0000 Subject: [PATCH 21/33] 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 c76666441beaf2e8748fa25d936a6b3f6262b18f Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Tue, 25 Apr 2023 01:20:46 +0000 Subject: [PATCH 22/33] 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 9ad9e9c97f4effc28a85a2814751464310878be2 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 01:07:31 +0000 Subject: [PATCH 23/33] 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 19c943e14be835e4b27b6761408d5faf3668c732 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Wed, 26 Apr 2023 01:19:50 +0000 Subject: [PATCH 24/33] 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 b6a2a01d234a8ba825dd8b6c5c9dbfd9b5afe35c Mon Sep 17 00:00:00 2001 From: Parth Joshi Date: Wed, 26 Apr 2023 07:37:57 -0700 Subject: [PATCH 25/33] Create 26- Add Digits (RotenKiwi).cpp --- .../26- Add Digits/26- Add Digits (RotenKiwi).cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits (RotenKiwi).cpp diff --git a/04- April/26- Add Digits/26- Add Digits (RotenKiwi).cpp b/04- April/26- Add Digits/26- Add Digits (RotenKiwi).cpp new file mode 100644 index 000000000..ebf0748cb --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (RotenKiwi).cpp @@ -0,0 +1,13 @@ +// Author: RotenKiwi +class Solution { +public: + int addDigits(int num) { + if(num<10)return num; // If number is less than 10, retrn it. + int curr=0; // Variable to store the digit sum. + while(num){ // Calculation of digit sum. + curr=curr+(num%10); + num=num/10; + } + return addDigits(curr); // Recurse the same for the new number + } +}; From c316333fe5948125e10ca3c10ff62945b407be83 Mon Sep 17 00:00:00 2001 From: Zeinab Mohy <95243799+Zeinab-Mohy@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:45:55 +0200 Subject: [PATCH 26/33] Create 26- Add Digits (Zeinab Mohy).cpp --- .../26- Add Digits (Zeinab Mohy).cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits (Zeinab Mohy).cpp diff --git a/04- April/26- Add Digits/26- Add Digits (Zeinab Mohy).cpp b/04- April/26- Add Digits/26- Add Digits (Zeinab Mohy).cpp new file mode 100644 index 000000000..2f0f22c17 --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (Zeinab Mohy).cpp @@ -0,0 +1,31 @@ +// Author: Zeinab Mohy + +class Solution { +public: + int addDigits(int num) { + //convert num into string to apply my idea + string s=to_string(num); + //if the length of string is greater than 1 then .. + if(s.length()>1){ + while(s.length()>1){ + /*initialize the summation of the digits with 0 + then sum the digits in string after convert all into integer + then convert summatiomn into string again and so on + until the length of string equal 1*/ + int sum=0; + string ss; + for(int i=0;i Date: Thu, 27 Apr 2023 01:56:13 +0200 Subject: [PATCH 27/33] add day 26 challenge --- .../26- Add Digits (Noura Algohary).cpp | 26 +++++++++++++++++++ .../26- Add Digits (Noura Algohary).py | 19 ++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 04- April/26- Add Digits/26- Add Digits (Noura Algohary).cpp create mode 100644 04- April/26- Add Digits/26- Add Digits (Noura Algohary).py diff --git a/04- April/26- Add Digits/26- Add Digits (Noura Algohary).cpp b/04- April/26- Add Digits/26- Add Digits (Noura Algohary).cpp new file mode 100644 index 000000000..b646fb405 --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (Noura Algohary).cpp @@ -0,0 +1,26 @@ +// Author: Noura Algohary +// beats 100% in runtime + +class Solution { +public: + int recursiveAddition(string num) + { + // the ending contidion is reaching a one digit number + if(num.size() == 1) + return (num[0] - '0'); + + // to store the summation of digits of num + int sumInt = 0; + + for(int i=num.size() - 1; i>=0; i--) + { + // convert the digit num[i] from char to int, then sum it + sumInt += num[i] - '0'; + } + + return recursiveAddition(to_string(sumInt)); + } + int addDigits(int num) { + return recursiveAddition(to_string(num)); + } +}; \ No newline at end of file diff --git a/04- April/26- Add Digits/26- Add Digits (Noura Algohary).py b/04- April/26- Add Digits/26- Add Digits (Noura Algohary).py new file mode 100644 index 000000000..ed964d65b --- /dev/null +++ b/04- April/26- Add Digits/26- Add Digits (Noura Algohary).py @@ -0,0 +1,19 @@ +# Author: Noura Algohary + +class Solution: + def addDigits(self, num: int) -> int: + + def recursiveAddition(num): + # the ending contidion is reaching a one digit number + if len(num) == 1: + return int(num) + + # to store the summation of digits of num + sumInt = 0 + + for i in range(len(num) - 1, -1, -1): + sumInt += int(num[i]) + + return recursiveAddition(str(sumInt)) + + return recursiveAddition(str(num)) \ No newline at end of file From ba16a9819019ff3e9f0cd8d0dd550994efb7b98e Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 27 Apr 2023 00:49:20 +0000 Subject: [PATCH 28/33] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/27- Bulb Switcher/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/27- Bulb Switcher/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1174ac2c5..a867e1ce9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -469,6 +469,10 @@ { "day": "26", "title": "Add Digits" + }, + { + "day": "27", + "title": "Bulb Switcher" } ] } \ No newline at end of file diff --git a/04- April/27- Bulb Switcher/.gitkeep b/04- April/27- Bulb Switcher/.gitkeep new file mode 100644 index 000000000..e69de29bb From d6abeccf27eb9637cafa470136e20503f6c2c1e3 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 27 Apr 2023 01:09:05 +0000 Subject: [PATCH 29/33] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/27- Bulb Switcher/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/27- Bulb Switcher/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1174ac2c5..a867e1ce9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -469,6 +469,10 @@ { "day": "26", "title": "Add Digits" + }, + { + "day": "27", + "title": "Bulb Switcher" } ] } \ No newline at end of file diff --git a/04- April/27- Bulb Switcher/.gitkeep b/04- April/27- Bulb Switcher/.gitkeep new file mode 100644 index 000000000..e69de29bb From 667df2ef8b8bc6adf53443f93dc28c0ca210a9b8 Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 27 Apr 2023 01:11:38 +0000 Subject: [PATCH 30/33] Add new daily problem --- .github/data/problems.json | 4 ++++ 04- April/27- Bulb Switcher/.gitkeep | 0 2 files changed, 4 insertions(+) create mode 100644 04- April/27- Bulb Switcher/.gitkeep diff --git a/.github/data/problems.json b/.github/data/problems.json index 1174ac2c5..a867e1ce9 100644 --- a/.github/data/problems.json +++ b/.github/data/problems.json @@ -469,6 +469,10 @@ { "day": "26", "title": "Add Digits" + }, + { + "day": "27", + "title": "Bulb Switcher" } ] } \ No newline at end of file diff --git a/04- April/27- Bulb Switcher/.gitkeep b/04- April/27- Bulb Switcher/.gitkeep new file mode 100644 index 000000000..e69de29bb From 1959cd7fccf9ed20fd53b53e86136fc5a6d7c88b Mon Sep 17 00:00:00 2001 From: aboelsoud Date: Thu, 27 Apr 2023 11:24:09 +0200 Subject: [PATCH 31/33] add the 27'th day problem solution --- .../27- Bulb Switcher (Mahmoud Aboelsoud).cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp diff --git a/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp b/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp new file mode 100644 index 000000000..f1c181be5 --- /dev/null +++ b/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp @@ -0,0 +1,15 @@ +// Auhtor: Mahmoud Aboelsoud + +class Solution { +public: + int bulbSwitch(int n) { + // for this problem we need to know how many light bulbs are on after n rounds + // to know that you need to know for each light bulb to stay on at the end it needs to have odd number of divisors + // the only numbers that have odd number of divisors are perfect squares + // so the answer is the number of perfect squares less than or equal to n + // which is sqrt(n) + + + return sqrt(n); + } +}; From d940016546b79365fabdac21bf2d432ea931b989 Mon Sep 17 00:00:00 2001 From: aboelsoud Date: Thu, 27 Apr 2023 11:26:02 +0200 Subject: [PATCH 32/33] fix author line --- .../27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp b/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp index f1c181be5..9cf4470fd 100644 --- a/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp +++ b/04- April/27- Bulb Switcher/27- Bulb Switcher (Mahmoud Aboelsoud).cpp @@ -1,4 +1,4 @@ -// Auhtor: Mahmoud Aboelsoud +// Author: Mahmoud Aboelsoud class Solution { public: From 8b713a2f71d7cdc119179efd49d8b84bd3c199ce Mon Sep 17 00:00:00 2001 From: 7oSkaaa Date: Thu, 27 Apr 2023 13:44:18 +0000 Subject: [PATCH 33/33] Add new daily problem to README --- 04- April/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/04- April/README.md b/04- April/README.md index c38621b74..989d6e96d 100644 --- a/04- April/README.md +++ b/04- April/README.md @@ -49,6 +49,7 @@ 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)** +1. **[Bulb Switcher](#27--bulb-switcher)**


@@ -1499,4 +1500,36 @@ public: } }; ``` + +
+

+ +## 27) [Bulb Switcher](https://leetcode.com/problems/bulb-switcher/) + +### Difficulty + +![](https://img.shields.io/badge/Medium-orange?style=for-the-badge) + +### Related Topic + +`Math` `Brainteaser` + +### Code + + +```cpp +class Solution { +public: + int bulbSwitch(int n) { + // for this problem we need to know how many light bulbs are on after n rounds + // to know that you need to know for each light bulb to stay on at the end it needs to have odd number of divisors + // the only numbers that have odd number of divisors are perfect squares + // so the answer is the number of perfect squares less than or equal to n + // which is sqrt(n) + + + return sqrt(n); + } +}; +``` \ No newline at end of file