From 997131207887e5f0477d8891cb38d67b24e685f0 Mon Sep 17 00:00:00 2001 From: ASR8127 <88731744+ASR8127@users.noreply.github.com> Date: Tue, 4 Oct 2022 05:14:54 +0530 Subject: [PATCH 01/75] Update README.md Add your YouTube channel I subscribed your channel --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f646806..7743bd3 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,5 @@ solve leetcode problems and add there solution file here as well. + +For More Knowledge you Checkout My YouTube channel https://youtube.com/c/CodingBuddies From b2532fbb3f83b40d961c1daab2b1178fb00f7d97 Mon Sep 17 00:00:00 2001 From: Sumeet Jain <68370214+sumeet2-lab@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:05:52 +0530 Subject: [PATCH 02/75] 1672-Leetcode solution --- 1672-richestcustomerwealth | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 1672-richestcustomerwealth diff --git a/1672-richestcustomerwealth b/1672-richestcustomerwealth new file mode 100644 index 0000000..3706b0e --- /dev/null +++ b/1672-richestcustomerwealth @@ -0,0 +1,20 @@ +class Solution { + public int maximumWealth(int[][] acc) { + int max=0; + for (int i=0;imax) + { + max=sum; + } + } + + return max; + } +} From 2faa59e920521d158e0bdd187ab0faa7804807cf Mon Sep 17 00:00:00 2001 From: Sumeet Jain <68370214+sumeet2-lab@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:20:10 +0530 Subject: [PATCH 03/75] Rename 1672-richestcustomerwealth to 1672-richestcustomerwealth.java --- 1672-richestcustomerwealth => 1672-richestcustomerwealth.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 1672-richestcustomerwealth => 1672-richestcustomerwealth.java (100%) diff --git a/1672-richestcustomerwealth b/1672-richestcustomerwealth.java similarity index 100% rename from 1672-richestcustomerwealth rename to 1672-richestcustomerwealth.java From 03b094369d68bb902b5bbccdd572741e1011d447 Mon Sep 17 00:00:00 2001 From: Sumeet Jain <68370214+sumeet2-lab@users.noreply.github.com> Date: Wed, 5 Oct 2022 23:58:02 +0530 Subject: [PATCH 04/75] Leetcode 73 --- 73-setmatrixzero.java | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 73-setmatrixzero.java diff --git a/73-setmatrixzero.java b/73-setmatrixzero.java new file mode 100644 index 0000000..572d835 --- /dev/null +++ b/73-setmatrixzero.java @@ -0,0 +1,65 @@ +class Solution { + public void setZeroes(int[][] matrix) { + int row=matrix.length; + int col=matrix[0].length; + int count=0; + + for(int i=0;i=0;f--) + { + if(matrix[f][j]!=0) + matrix[f][j]=-1; + } + for(int f=i+1;f=0;f--) + {if(matrix[i][f]!=0) + matrix[i][f]=-1; + } + for(int f=j+1;f Date: Fri, 7 Oct 2022 17:51:35 +0530 Subject: [PATCH 05/75] Add files via upload --- Letter_Combinations_of_a_Phone_Number.cpp | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Letter_Combinations_of_a_Phone_Number.cpp diff --git a/Letter_Combinations_of_a_Phone_Number.cpp b/Letter_Combinations_of_a_Phone_Number.cpp new file mode 100644 index 0000000..ccbc92a --- /dev/null +++ b/Letter_Combinations_of_a_Phone_Number.cpp @@ -0,0 +1,32 @@ +class Solution { +private: + void solve(string digit, string output, int index, vector& ans, string mapping[]){ + //base case + if(index >= digit.length()){ + ans.push_back(output); + return; + } + + int number = digit[index] - '0'; + string value = mapping[number]; + + for(int i=0; i letterCombinations(string digits) { + vector ans; + if(digits.length()==0){ + return ans; + } + string output = ""; + int index = 0; + string mapping[10] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; + solve(digits, output, index, ans, mapping); + return ans; + } +}; \ No newline at end of file From a881c04810a65d324e9f674ac594932e568565bd Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Fri, 7 Oct 2022 22:00:23 +0530 Subject: [PATCH 06/75] A LeetCode Problem Solution Using C++ --- cancelTrains.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 cancelTrains.cpp diff --git a/cancelTrains.cpp b/cancelTrains.cpp new file mode 100644 index 0000000..d24b6dd --- /dev/null +++ b/cancelTrains.cpp @@ -0,0 +1,52 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for (int i = n - 1; i >= 0; i--) +#define rep(i, n) for (int i = 0; i < n; i++) +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + +int main() +{ + + int t, n, m; + cin >> t; + while (t--) + { + cin >> n >> m; + int a[n]; + int b[m]; + int c = 0; + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } + for (int j = 0; j < m; j++) + { + cin >> b[j]; + } + for (int k = 0; k < n; k++) + { + for (int p = 0; p < m; p++) + { + if (a[k] == b[p]) + { + c++; + } + } + } + cout << c << endl; + } + return 0; +} From eabf5292d79b900aa21fff1b6d6be7750641a6ec Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Sat, 8 Oct 2022 00:38:32 +0530 Subject: [PATCH 07/75] Binary Search Code using C language --- binarySearch.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 binarySearch.c diff --git a/binarySearch.c b/binarySearch.c new file mode 100644 index 0000000..d77c44e --- /dev/null +++ b/binarySearch.c @@ -0,0 +1,38 @@ +#include +#include +int main() +{ + int n, key,l,h,mid,x; + printf("Enter the size of Array"); + scanf("%d", &n); + int a[n]; + printf("Enter the key"); + scanf("%d", &key); + printf("Enter the elements of Array"); + for (int i = 0; i < n; i++) + { + scanf("%d", &a[i]); + } + l = 0; + h = n - 1; + mid = ((l + h)/2); + x=mid; + while (l <= h) + { + if (key == a[x]) + { + printf("position of the key in array\n"); + printf("%d",x); + break; + } + if (a[x] > key) + { + h = x - 1; + } + if (a[x] < key) + { + l = x + 1; + } + } + return 0; +} \ No newline at end of file From 2e5d7d7bdb9eb2f242393893c29155b92de3a17d Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Sat, 8 Oct 2022 01:18:43 +0530 Subject: [PATCH 08/75] Matrix Sum and difference in C language --- Matrix.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Matrix.c diff --git a/Matrix.c b/Matrix.c new file mode 100644 index 0000000..d187a39 --- /dev/null +++ b/Matrix.c @@ -0,0 +1,65 @@ +#include +#include +int main(){ + int a[10][10],b[10][10],c[10][10],d[10][10], row, col,i,j; + + printf("Enter the rows number of both matrices\n"); + scanf("%d",&row); + printf("Enter the columns number of both matrices\n"); + scanf("%d",&col); + + + printf("Enter the elements of matrix A\n"); + for(i=0;i Date: Sat, 8 Oct 2022 08:50:05 +0530 Subject: [PATCH 09/75] Create 204_count_primes.java --- 204_count_primes.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 204_count_primes.java diff --git a/204_count_primes.java b/204_count_primes.java new file mode 100644 index 0000000..4f557b7 --- /dev/null +++ b/204_count_primes.java @@ -0,0 +1,23 @@ +class Solution{ +public int countPrimes(int n) { + if(n <=1 ) return 0; + + boolean[] notPrime = new boolean[n]; + notPrime[0] = true; + notPrime[1] = true; + + for(int i = 2; i < Math.sqrt(n); i++){ + if(!notPrime[i]){ + for(int j = 2; j*i < n; j++){ + notPrime[i*j] = true; + } + } + } + + int count = 0; + for(int i = 2; i< notPrime.length; i++){ + if(!notPrime[i]) count++; + } + return count; +} +} From cfa04cd78cdd22c8b1c757b5302a44f642d70327 Mon Sep 17 00:00:00 2001 From: Prashant Gehlot <98162883+prashant-gehlot@users.noreply.github.com> Date: Sat, 8 Oct 2022 09:37:07 +0530 Subject: [PATCH 10/75] Create best_time_to_buy_and_sell_stock.cpp --- best_time_to_buy_and_sell_stock.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 best_time_to_buy_and_sell_stock.cpp diff --git a/best_time_to_buy_and_sell_stock.cpp b/best_time_to_buy_and_sell_stock.cpp new file mode 100644 index 0000000..fc5f588 --- /dev/null +++ b/best_time_to_buy_and_sell_stock.cpp @@ -0,0 +1,12 @@ +class Solution { +public: + int maxProfit(vector& prices) { + int maxPro = 0; + int minPrice = INT_MAX; + for(int i=0; i Date: Sun, 9 Oct 2022 13:26:57 +0530 Subject: [PATCH 11/75] 3Sum_Closest.java --- 16. 3Sum Closest | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 16. 3Sum Closest diff --git a/16. 3Sum Closest b/16. 3Sum Closest new file mode 100644 index 0000000..a8f9d1e --- /dev/null +++ b/16. 3Sum Closest @@ -0,0 +1,49 @@ +class Solution { + public int threeSumClosest(int[] nums, int target) { + int n = nums.length; + int res = 0; + int m = Integer.MAX_VALUE; + Arrays.sort(nums); + for (int i = 0; i < n - 2; i++){ + if (i > 0 && nums[i-1] == nums[i]){ + continue; + } + if (nums[i] * 3 >= target){ + int s = nums[i] + nums[i+1] + nums[i+2]; + if (s - target < m){ + return s; + } + break; + } + int t = nums[i] + nums[n-1] + nums[n-2]; + if (t == target){ + return t; + } + if (t < target){ + if (t - target < m){ + m = target - t; + res = t; + } + continue; + } + int a = i + 1; + int b = n - 1; + while (a < b){ + t = nums[i] + nums[a] + nums[b]; + if (t == target){ + return t; + } + if (Math.abs(t - target) < m){ + res = t; + m = Math.abs(t - target); + } + if (t > target){ + b--; + } else { + a++; + } + } + } + return res; + } +} From f66f0aba03a892e3feb27f1a501fcd7927f564fa Mon Sep 17 00:00:00 2001 From: Abhishek Gaurav Date: Sun, 9 Oct 2022 21:08:05 +0530 Subject: [PATCH 12/75] Create 25. Reverse Nodes in k-Group.cpp It is a C++ code snippet solution for leetcode question 25. Reverse Nodes in k-Group (Hard). It is solved using three pointers: previous, current & next. It uses an iterative approach. --- 25. Reverse Nodes in k-Group.cpp | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 25. Reverse Nodes in k-Group.cpp diff --git a/25. Reverse Nodes in k-Group.cpp b/25. Reverse Nodes in k-Group.cpp new file mode 100644 index 0000000..6246b33 --- /dev/null +++ b/25. Reverse Nodes in k-Group.cpp @@ -0,0 +1,53 @@ +class Solution { +public: + void reverse(ListNode *start, ListNode *end) + { + ListNode *prev = NULL; + ListNode *curr = start; + ListNode *nexty = start->next; + + while(prev!=end) + { + curr->next = prev; + prev = curr; + curr = nexty; + + if(nexty!=NULL) + { + nexty = nexty->next; + } + } + + } + + ListNode* reverseKGroup(ListNode* head, int k) { + + if(head==NULL || head->next == NULL || k==1) + return head; + + ListNode *dummy = new ListNode(-1); + dummy->next = head; + ListNode *beforeStart = dummy, *end = head; + int i=0; + while(end!=NULL) + { + i++; + if(i%k==0) + { + //reversal + ListNode *start = beforeStart->next, *temp = end->next; + reverse(start,end); + beforeStart->next = end; + start->next = temp; + beforeStart = start; + end = temp; + } + else + { + end = end->next; + } + + } + return dummy->next; + } +}; From f1c2645ec82c35fe9597142f34ec57dd3e21510d Mon Sep 17 00:00:00 2001 From: Abhishek Gaurav Date: Mon, 10 Oct 2022 20:58:47 +0530 Subject: [PATCH 13/75] Create 1206. Design Skiplist (Hard) --- 1206. Design Skiplist (Hard) | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 1206. Design Skiplist (Hard) diff --git a/1206. Design Skiplist (Hard) b/1206. Design Skiplist (Hard) new file mode 100644 index 0000000..61ad7dd --- /dev/null +++ b/1206. Design Skiplist (Hard) @@ -0,0 +1,39 @@ +class Skiplist { +public: + + maps; + + Skiplist() { + + } + + bool search(int target) { + if(s.find(target)!=s.end()) + return true; + else + return false; + } + + void add(int num) { + s[num]++; + } + + bool erase(int num) { + if(s.find(num)==s.end()) + return false; + else{ + s[num]--; + if(s[num]==0) + s.erase(num); + return true; + } + } +}; + +/** + * Your Skiplist object will be instantiated and called as such: + * Skiplist* obj = new Skiplist(); + * bool param_1 = obj->search(target); + * obj->add(num); + * bool param_3 = obj->erase(num); + */ From 91d87e8781a442bbfb28ff0bee7f855364444292 Mon Sep 17 00:00:00 2001 From: Ak56827 <75605021+Ak56827@users.noreply.github.com> Date: Wed, 12 Oct 2022 00:37:41 +0530 Subject: [PATCH 14/75] Create 334. Increasing Triplet Subsequence level : Medium --- 334. Increasing Triplet Subsequence | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 334. Increasing Triplet Subsequence diff --git a/334. Increasing Triplet Subsequence b/334. Increasing Triplet Subsequence new file mode 100644 index 0000000..34e3d44 --- /dev/null +++ b/334. Increasing Triplet Subsequence @@ -0,0 +1,14 @@ +class Solution: + def increasingTriplet(self, nums: List[int]) -> bool: + first = math.inf + second = math.inf + + for num in nums: + if num <= first: + first = num + elif num <= second: # First < num <= second + second = num + else: + return True # First < second < num (third) + + return False From 6e5fd20235d0dabfb7d55746b6015af406046a7a Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Wed, 12 Oct 2022 09:02:42 +0530 Subject: [PATCH 15/75] A C++ code to compare different Shirt Sizes --- ShirtSize.cpp | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 ShirtSize.cpp diff --git a/ShirtSize.cpp b/ShirtSize.cpp new file mode 100644 index 0000000..1867533 --- /dev/null +++ b/ShirtSize.cpp @@ -0,0 +1,115 @@ +// shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for (int i = n - 1; i >= 0; i--) +#define rep(i, n) for (int i = 0; i < n; i++) +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + +int main() +{ + + int t; + cin >> t; + while (t--) + { + string a, b; + cin >> a >> b; + int n1 = a.length(); + int n2 = b.length(); + char x = a.at(n1 - 1); + char y = b.at(n2 - 1); + if (n1 == n2) + { + if (x == y) + { + cout << "=" << endl; + } + if ((x == 'M') && (y == 'S')) + { + cout << ">" << endl; + } + if ((x == 'S') && (y == 'M')) + { + cout << "<" << endl; + } + if ((x == 'L') && (y == 'S')) + { + cout << ">" << endl; + } + if ((x == 'S') && (y == 'L')) + { + cout << "<" << endl; + } + if ((x == 'L') && (y == 'M')) + { + cout << ">" << endl; + } + if ((x == 'M') && (y == 'L')) + { + cout << "<" << endl; + } + } + if (n1 != n2) + { + if (x == y) + { + if ((x == 'L') && (n1 > n2)) + { + cout << ">" << endl; + } + if ((x == 'L') && (n2 > n1)) + { + cout << "<" << endl; + } + if ((x == 'S') && (n1 > n2)) + { + cout << "<" << endl; + } + if ((x == 'S') && (n2 > n1)) + { + cout << ">" << endl; + } + } + if (x != y) + { + if ((x == 'M') && (y == 'S')) + { + cout << ">" << endl; + } + if ((x == 'S') && (y == 'M')) + { + cout << "<" << endl; + } + if ((x == 'L') && (y == 'S')) + { + cout << ">" << endl; + } + if ((x == 'S') && (y == 'L')) + { + cout << "<" << endl; + } + if ((x == 'L') && (y == 'M')) + { + cout << ">" << endl; + } + if ((x == 'M') && (y == 'L')) + { + cout << "<" << endl; + } + } + } + } + return 0; +} From b38f3a08354ddae15fa0cdea41ea2e12722c62a8 Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Wed, 12 Oct 2022 09:20:55 +0530 Subject: [PATCH 16/75] A C++ code to find the length of the longest segment of an Array --- Thickness.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Thickness.cpp diff --git a/Thickness.cpp b/Thickness.cpp new file mode 100644 index 0000000..024cceb --- /dev/null +++ b/Thickness.cpp @@ -0,0 +1,41 @@ +#include +using namespace std; + +int main() +{ + + int x1; + cin >> x1; + while (x1--) + { + int x; + cin >> x; + if (x == 3) + cout << "-1" << endl; + else + { + if (x % 2) + { + int kas = (x / 2) + 1; + for (int j = x; j > kas; j--) + { + cout << i << " "; + } + for (int j = 1; j <= kas; j++) + { + cout << j << " "; + } + cout << endl; + } + else + { + for (int k = x; k >= 1; k--) + { + cout << k << " "; + } + cout << endl; + } + } + } + return 0; +} \ No newline at end of file From e2cc50d13eee731f2ce36e8581475ba86aa9c31c Mon Sep 17 00:00:00 2001 From: Akshat2024 Date: Wed, 12 Oct 2022 09:47:02 +0530 Subject: [PATCH 17/75] Linear Search Code in C --- LinearSearch.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 LinearSearch.cpp diff --git a/LinearSearch.cpp b/LinearSearch.cpp new file mode 100644 index 0000000..4f7427a --- /dev/null +++ b/LinearSearch.cpp @@ -0,0 +1,30 @@ +#include +#include +int main() +{ + int array[100], search, c, n; + + printf("Enter number of elements in array\n"); + scanf("%d", &n); + + printf("Enter %d integer(s)\n", n); + + for (c = 0; c < n; c++) + scanf("%d", &array[c]); + + printf("Enter a number to search\n"); + scanf("%d", &search); + + for (c = 0; c < n; c++) + { + if (array[c] == search) /* If required element is found */ + { + printf("%d is present at location %d.\n", search, c+1); + break; + } + } + if (c == n) + printf("%d isn't present in the array.\n", search); + + return 0; +} \ No newline at end of file From 0af3261214d2c7c50f5449ac5a7eea61351fa945 Mon Sep 17 00:00:00 2001 From: dadangbudi Date: Wed, 12 Oct 2022 16:52:24 +0700 Subject: [PATCH 18/75] add-pattern-logic --- pattern.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pattern.cpp diff --git a/pattern.cpp b/pattern.cpp new file mode 100644 index 0000000..61dc723 --- /dev/null +++ b/pattern.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; + +void pypart2(int n) +{ + int i = 0, j = 0, k = 0; + while (i < n) { + + while (k <= n - i - 2) { + cout << " "; + k++; + } + k = 0; + + while (j < 2 * i - 1) { + cout << "*"; + j++; + } + j = 0; + i++; + cout << endl; + } +} + +int main() +{ + int n = 5; + + pypart2(n); + return 0; +} From c6547591fc4b9dacb2a1c48552d8736e070f3baf Mon Sep 17 00:00:00 2001 From: Gautam goel Date: Fri, 14 Oct 2022 01:41:56 +0530 Subject: [PATCH 19/75] Added, leetcode weekly 314, cpp solutions, for first three questions, (CD) --- leetcode_contest_314_solutions/1.cpp | 0 leetcode_contest_314_solutions/2.cpp | 0 leetcode_contest_314_solutions/3.cpp | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 leetcode_contest_314_solutions/1.cpp create mode 100644 leetcode_contest_314_solutions/2.cpp create mode 100644 leetcode_contest_314_solutions/3.cpp diff --git a/leetcode_contest_314_solutions/1.cpp b/leetcode_contest_314_solutions/1.cpp new file mode 100644 index 0000000..e69de29 diff --git a/leetcode_contest_314_solutions/2.cpp b/leetcode_contest_314_solutions/2.cpp new file mode 100644 index 0000000..e69de29 diff --git a/leetcode_contest_314_solutions/3.cpp b/leetcode_contest_314_solutions/3.cpp new file mode 100644 index 0000000..e69de29 From 8ee64f3b1fa7b11e6d9e116ae3cd5dab537e8e92 Mon Sep 17 00:00:00 2001 From: Anshika123 Date: Fri, 14 Oct 2022 22:40:08 +0530 Subject: [PATCH 20/75] wild-card-matching --- wildcard-matching.java | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 wildcard-matching.java diff --git a/wildcard-matching.java b/wildcard-matching.java new file mode 100644 index 0000000..c76d579 --- /dev/null +++ b/wildcard-matching.java @@ -0,0 +1,39 @@ +public class WildcardMatching { + + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + System.out.println(new WildcardMatching().isMatch("abebd", "?be******e")); + } + + public boolean isMatch(String s, String p) { + int starIdx = -1; + int starPosAtStr = -1; + int j = 0; + for (int i = 0, l = s.length(); i < l; ) { + if (j < p.length()) { + if (s.charAt(i) == p.charAt(j) || p.charAt(j) == '?') { + i++; + j++; + } else if (p.charAt(j) == '*') { + starIdx = j; + starPosAtStr = i; + j++; // increment only pattern index. This is because '*' can match also empty string. + } else if (starIdx != -1) { + i = ++starPosAtStr; + j = starIdx + 1; + } else return false; + } else if (starIdx != -1) { + i = ++starPosAtStr; + j = starIdx + 1; + } else return false; + } + while (j < p.length()) { + if (p.charAt(j) == '*') { + j++; + } else break; + } + return j == p.length(); + } +} \ No newline at end of file From 1d3d044cc0d4b9121d0d0785dd8ace875f1c2614 Mon Sep 17 00:00:00 2001 From: Raj kushwaha <87632065+Rajkushwaha0@users.noreply.github.com> Date: Sat, 15 Oct 2022 01:40:26 +0530 Subject: [PATCH 21/75] Add Two sum optimize solution --- 1-Two Sum | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 1-Two Sum diff --git a/1-Two Sum b/1-Two Sum new file mode 100644 index 0000000..286b5d2 --- /dev/null +++ b/1-Two Sum @@ -0,0 +1,37 @@ +//Question- 1 +Link: https://leetcode.com/problems/two-sum/ +class Solution { + public int[] twoSum(int[] nums, int target) { + int c=0; + int[] b; + b= new int [2]; + for(int i=0;i hm = new HashMap<>(); + for(int i=0;i Date: Sat, 15 Oct 2022 01:51:38 +0530 Subject: [PATCH 22/75] Optimize valid parentheses --- 20-Valid Parentheses | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 20-Valid Parentheses diff --git a/20-Valid Parentheses b/20-Valid Parentheses new file mode 100644 index 0000000..3e234bb --- /dev/null +++ b/20-Valid Parentheses @@ -0,0 +1,51 @@ +//https://leetcode.com/problems/valid-parentheses/ +//0ms +class Solution { + public boolean isValid(String s) { + if(s.length()==1) return false; + Stack stack = new Stack<>(); + for(int i = 0;i < s.length();i++){ + char ch=s.charAt(i); + if(ch=='(' || ch=='{' || ch=='['){ + stack.push(ch); + } + if(ch==')'){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='('){ + stack.pop(); + } + else { + return false; + } + } + if(ch==']' ){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='['){ + stack.pop(); + } + else{ + return false; + } + } + if(ch=='}'){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='{'){ + stack.pop(); + } + else{ + return false; + } + } + } + if(stack.isEmpty()){ + return true; + } + + } +} From 07c1845bc5b98f55cacdeaf333c9dc321890a548 Mon Sep 17 00:00:00 2001 From: Raj kushwaha <87632065+Rajkushwaha0@users.noreply.github.com> Date: Sat, 15 Oct 2022 01:54:31 +0530 Subject: [PATCH 23/75] Optimize Valid Parentheses --- JAVA-20-Valid_Parentheses | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 JAVA-20-Valid_Parentheses diff --git a/JAVA-20-Valid_Parentheses b/JAVA-20-Valid_Parentheses new file mode 100644 index 0000000..e276305 --- /dev/null +++ b/JAVA-20-Valid_Parentheses @@ -0,0 +1,51 @@ +//https://leetcode.com/problems/valid-parentheses/ +//0ms +class Solution { + public boolean isValid(String s) { + if(s.length()==1) return false; + Stack stack = new Stack<>(); + for(int i = 0;i < s.length();i++){ + char ch=s.charAt(i); + if(ch=='(' || ch=='{' || ch=='['){ + stack.push(ch); + } + if(ch==')'){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='('){ + stack.pop(); + } + else { + return false; + } + } + if(ch==']' ){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='['){ + stack.pop(); + } + else{ + return false; + } + } + if(ch=='}'){ + if(stack.isEmpty()){ + return false; + } + else if(stack.peek()=='{'){ + stack.pop(); + } + else{ + return false; + } + } + } + if(stack.isEmpty()){ + return true; + } + + } +} From 637014fb8d9eacab114ff07550443fdc91e6f2de Mon Sep 17 00:00:00 2001 From: Anuj Srivastav <112340128+Anujsrivastav119@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:37:48 +0530 Subject: [PATCH 24/75] Update 268.Missing_Number.java --- 268.Missing_Number.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/268.Missing_Number.java b/268.Missing_Number.java index 14035b8..9f0428e 100644 --- a/268.Missing_Number.java +++ b/268.Missing_Number.java @@ -3,7 +3,7 @@ public int missingNumber(int[] nums) { int n = nums.length; int sum = (n * (n+1)) / 2; for(int i=0; i Date: Sat, 15 Oct 2022 21:46:09 +0530 Subject: [PATCH 25/75] Update 61. Rotate List --- 61. Rotate List | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/61. Rotate List b/61. Rotate List index 6857e3f..64f3e4f 100644 --- a/61. Rotate List +++ b/61. Rotate List @@ -17,10 +17,10 @@ public: while(head == NULL || head -> next == NULL || k==0) return head; while(curr -> next != NULL) - { - len++; + { + len++; curr = curr -> next; - } + } curr -> next = head; k = k % len; k = len - k; From 6aa23d31e2e3dc593aff3e7c4f335147f2658eeb Mon Sep 17 00:00:00 2001 From: Anuj Srivastav <112340128+Anujsrivastav119@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:46:45 +0530 Subject: [PATCH 26/75] Update 61. Rotate List --- 61. Rotate List | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/61. Rotate List b/61. Rotate List index 64f3e4f..8642aa7 100644 --- a/61. Rotate List +++ b/61. Rotate List @@ -20,7 +20,7 @@ public: { len++; curr = curr -> next; - } + } curr -> next = head; k = k % len; k = len - k; From e62c483c71960647398b4fe5f70c55e9ad09131f Mon Sep 17 00:00:00 2001 From: Anuj Srivastav <112340128+Anujsrivastav119@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:07:29 +0530 Subject: [PATCH 27/75] Update 7.reverseInteger.cpp --- 7.reverseInteger.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/7.reverseInteger.cpp b/7.reverseInteger.cpp index f93234a..a17fae5 100644 --- a/7.reverseInteger.cpp +++ b/7.reverseInteger.cpp @@ -13,9 +13,9 @@ class Solution { num = num + (x % 10); x = x / 10; } - } + } else{ - x = -1 * x; + x = -1 * x; while(x > 0){ num = num * 10; if( num >= 2147483647 || num <= -2147483648) @@ -27,4 +27,4 @@ class Solution { } return int(num); } -}; \ No newline at end of file +}; From 4bc970a48517c27b010411b18c442d7670216c7a Mon Sep 17 00:00:00 2001 From: Anuj Srivastav <112340128+Anujsrivastav119@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:08:05 +0530 Subject: [PATCH 28/75] Update 7.reverseInteger.cpp --- 7.reverseInteger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7.reverseInteger.cpp b/7.reverseInteger.cpp index a17fae5..e188630 100644 --- a/7.reverseInteger.cpp +++ b/7.reverseInteger.cpp @@ -13,7 +13,7 @@ class Solution { num = num + (x % 10); x = x / 10; } - } + } else{ x = -1 * x; while(x > 0){ From 53de74db319bd70865530885dd1a5deba0af1873 Mon Sep 17 00:00:00 2001 From: Anuj Srivastav <112340128+Anujsrivastav119@users.noreply.github.com> Date: Sat, 15 Oct 2022 22:10:16 +0530 Subject: [PATCH 29/75] Update 112. Path sum --- 112. Path sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/112. Path sum b/112. Path sum index 958939c..a0068df 100644 --- a/112. Path sum +++ b/112. Path sum @@ -10,10 +10,10 @@ if(root == null) return false; currSum += root.val; if(targetSum == currSum) { return true; - } + } else{ return false; - } + } } From 5455c2d04bc065cfeebf78039cbba781d9caff24 Mon Sep 17 00:00:00 2001 From: Raj kushwaha <87632065+Rajkushwaha0@users.noreply.github.com> Date: Sat, 15 Oct 2022 23:19:54 +0530 Subject: [PATCH 30/75] Max Consecutive Ones III --- 1004. Max Consecutive Ones III | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 1004. Max Consecutive Ones III diff --git a/1004. Max Consecutive Ones III b/1004. Max Consecutive Ones III new file mode 100644 index 0000000..0da9dc8 --- /dev/null +++ b/1004. Max Consecutive Ones III @@ -0,0 +1,22 @@ +Link: https://leetcode.com/problems/max-consecutive-ones-iii/ + +//JAVA Solution +//O(n) Optimize +class Solution { + public int longestOnes(int[] nums, int k) { + int ws = 0 , max = 0 , count = 0; + HashMap hm = new HashMap<>(); + for(int we = 0 ; we < nums.length ; we++){ + // if(nums[we] == 0) count++; + if(nums[we]==0) hm.put(nums[we],hm.getOrDefault(nums[we],0)+1); + while(nums[we]==0 && hm.get(nums[we]) > k){ + if(nums[ws] == 0){ + hm.put(nums[ws],hm.get(nums[ws])-1); + } + ws++; + } + max=Math.max(max,we-ws+1); + } + return max; + } +} From d1805f5632fdf74c58dfba4c576dc73cb2a31060 Mon Sep 17 00:00:00 2001 From: SubratKumar Date: Mon, 17 Oct 2022 07:29:37 +0530 Subject: [PATCH 31/75] Added rotate matrix problem of leetcode --- Rotate_Matrix_by_90_degrees.java | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Rotate_Matrix_by_90_degrees.java diff --git a/Rotate_Matrix_by_90_degrees.java b/Rotate_Matrix_by_90_degrees.java new file mode 100644 index 0000000..e78337d --- /dev/null +++ b/Rotate_Matrix_by_90_degrees.java @@ -0,0 +1,35 @@ +//You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). +//https://leetcode.com/problems/rotate-image/ + +public class Rotate_Matrix_by_90_degrees { + + public static int[][] transpose(int [][] ary){ + int rows=ary.length; + for (int i=0;i Date: Mon, 17 Oct 2022 16:15:51 +0530 Subject: [PATCH 32/75] Leet Code solution for integer to roman conversion. --- integertoroman.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 integertoroman.c diff --git a/integertoroman.c b/integertoroman.c new file mode 100644 index 0000000..14cd775 --- /dev/null +++ b/integertoroman.c @@ -0,0 +1,38 @@ +#include +typedef struct{ + char *sym; + int val; +}numeral; +int maxNume(numeral *nu, int num){ + int i, index; + for(i = 0; i<15; i++){//15 numerals in array + if(nu[i].val <= num) + index = i; + } + //gretest value numeral index, not greater than number + return index; +} +void decToRoman(numeral *nu, int num){ + int max; + if(num != 0){ + max = maxNume(nu, num); + printf("%s", nu[max].sym); + num -= nu[max].val;//decrease number + decToRoman(nu, num);//recursively print numerals + } +} +main(){ + int number; + numeral nume[15] = {{"I",1},{"IV",4},{"V",5},{"IX",9}, {"X",10},{"XL",40},{"L",50},{"XC",90}, +{"C",100},{"CD",400},{"D",500},{"CM",900},{"M",1000},{"MMMM",4000},{"V'",5000}}; + printf("Enter a decimal number: "); + scanf("%d", &number); + if(number >0 && number <= 5000){//checking input number + printf("The Roman equivalent of %d is ", number); + decToRoman(nume, number); + } + else{ + printf("Invalid Input"); + } + printf("\n"); +} From 785a2418312800507a6e6b02adc95ef48f23dc03 Mon Sep 17 00:00:00 2001 From: jpriyanshu1406 <113455126+jpriyanshu1406@users.noreply.github.com> Date: Mon, 17 Oct 2022 18:49:23 +0530 Subject: [PATCH 33/75] Create N QUEENS --- N QUEENS | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 N QUEENS diff --git a/N QUEENS b/N QUEENS new file mode 100644 index 0000000..3ebf386 --- /dev/null +++ b/N QUEENS @@ -0,0 +1,29 @@ +class Solution { + public: + vector> solveNQueens(int n) { + vector> ans; + dfs(n, 0, vector(n), vector(2 * n - 1), vector(2 * n - 1), + vector(n, string(n, '.')), ans); + return ans; + } + + private: + void dfs(int n, int i, vector&& cols, vector&& diag1, + vector&& diag2, vector&& board, + vector>& ans) { + if (i == n) { + ans.push_back(board); + return; + } + + for (int j = 0; j < n; ++j) { + if (cols[j] || diag1[i + j] || diag2[j - i + n - 1]) + continue; + board[i][j] = 'Q'; + cols[j] = diag1[i + j] = diag2[j - i + n - 1] = true; + dfs(n, i + 1, move(cols), move(diag1), move(diag2), move(board), ans); + cols[j] = diag1[i + j] = diag2[j - i + n - 1] = false; + board[i][j] = '.'; + } + } +}; From 822025d64bf91ec7077d93056729672976173d86 Mon Sep 17 00:00:00 2001 From: Raj kushwaha <87632065+Rajkushwaha0@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:25:53 +0530 Subject: [PATCH 34/75] Longest Substring Without Repeating Characters --- 3-Longest Substring Without Repeating Characters | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 3-Longest Substring Without Repeating Characters diff --git a/3-Longest Substring Without Repeating Characters b/3-Longest Substring Without Repeating Characters new file mode 100644 index 0000000..65a07b0 --- /dev/null +++ b/3-Longest Substring Without Repeating Characters @@ -0,0 +1,12 @@ +class Solution: + def lengthOfLongestSubstring(self, s: str) -> int: + l=0 + res=0 + charset=set() + for r in range(len(s)): + while(s[r] in charset): + charset.remove(s[l]) + l+=1 + charset.add(s[r]) + res=max(res,r-l+1) + return (res) From 4d4a7991da57275b4067be9c90f9c5a3f42fa0c3 Mon Sep 17 00:00:00 2001 From: Rakesh Roshan Date: Tue, 18 Oct 2022 11:10:15 +0530 Subject: [PATCH 35/75] 42. Trapping Rain Water --- TrappingRainWater.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 TrappingRainWater.cpp diff --git a/TrappingRainWater.cpp b/TrappingRainWater.cpp new file mode 100644 index 0000000..7720932 --- /dev/null +++ b/TrappingRainWater.cpp @@ -0,0 +1,21 @@ +class Solution { + public: + int trap(vector& height) { + const int n = height.size(); + int ans = 0; + vector l(n); // l[i] := max(height[0..i]) + vector r(n); // r[i] := max(height[i..n)) + + for (int i = 0; i < n; ++i) + l[i] = i == 0 ? height[i] : max(height[i], l[i - 1]); + + for (int i = n - 1; i >= 0; --i) + r[i] = i == n - 1 ? height[i] : max(height[i], r[i + 1]); + + for (int i = 0; i < n; ++i) + ans += min(l[i], r[i]) - height[i]; + + return ans; + } +}; + From 95767fbd8c09e3031e9afefd7b87156a0bde37c4 Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:14:53 +0530 Subject: [PATCH 36/75] Add files via upload --- N_Queen.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 N_Queen.cpp diff --git a/N_Queen.cpp b/N_Queen.cpp new file mode 100644 index 0000000..9dec166 --- /dev/null +++ b/N_Queen.cpp @@ -0,0 +1,36 @@ +class Solution { +public: + void solve(int col, vector &board, vector> &ans, vector &leftRow, vector &upperDiagonal, vector &lowerDiagonal, int n){ + //base case + if(col == n){ + ans.push_back(board); + return; + } + + for(int row=0; row> solveNQueens(int n) { + vector> ans; + vector board(n); + string s(n, '.'); + for(int i=0; i leftRow(n, 0), upperDiagonal(2 * n - 1, 0), lowerDiagonal(2 * n - 1, 0); + solve(0, board, ans, leftRow, upperDiagonal, lowerDiagonal, n); + return ans; + } +}; \ No newline at end of file From dff26b3824ee1cfd49b70b3dcc104ac34f78de5e Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:21:58 +0530 Subject: [PATCH 37/75] Add files via upload --- Intersection_of_Two_LL.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Intersection_of_Two_LL.cpp diff --git a/Intersection_of_Two_LL.cpp b/Intersection_of_Two_LL.cpp new file mode 100644 index 0000000..0336875 --- /dev/null +++ b/Intersection_of_Two_LL.cpp @@ -0,0 +1,22 @@ +class Solution { +public: + ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { + ListNode* a = headA, *b = headB; + while(a != b){ + if(a == NULL){ + a = headB; + } + else{ + a = a -> next; + } + + if(b == NULL){ + b = headA; + } + else{ + b = b -> next; + } + } + return a; + } +}; \ No newline at end of file From 97436d735f966d8508c0e12a1ed3e08a472248c9 Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:32:59 +0530 Subject: [PATCH 38/75] Add files via upload --- Convert_Sorted_Array_To_BST.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Convert_Sorted_Array_To_BST.cpp diff --git a/Convert_Sorted_Array_To_BST.cpp b/Convert_Sorted_Array_To_BST.cpp new file mode 100644 index 0000000..40dbfbe --- /dev/null +++ b/Convert_Sorted_Array_To_BST.cpp @@ -0,0 +1,20 @@ +class Solution { +public: + TreeNode* solve(vector &nums, int start, int end){ + //base case + if(start > end){ + return NULL; + } + + int mid = (start + end)/2; + TreeNode* temp = new TreeNode(nums[mid]); + + temp -> left = solve(nums, start, mid-1); + temp -> right = solve(nums, mid+1, end); + return temp; + } + + TreeNode* sortedArrayToBST(vector& nums) { + return solve(nums, 0, nums.size()-1); + } +}; \ No newline at end of file From 03e1a245bcb4071a2b917f3c16b35ffe462b6585 Mon Sep 17 00:00:00 2001 From: Rakesh Roshan Date: Tue, 18 Oct 2022 18:43:57 +0530 Subject: [PATCH 39/75] 61. Rotate List --- 61. Rotate List.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 61. Rotate List.cpp diff --git a/61. Rotate List.cpp b/61. Rotate List.cpp new file mode 100644 index 0000000..e531875 --- /dev/null +++ b/61. Rotate List.cpp @@ -0,0 +1,21 @@ +class Solution { + public: + ListNode* rotateRight(ListNode* head, int k) { + if (!head || !head->next || k == 0) + return head; + + ListNode* tail; + int length = 1; + for (tail = head; tail->next; tail = tail->next) + ++length; + tail->next = head; // Circle the list + + const int t = length - k % length; + for (int i = 0; i < t; ++i) + tail = tail->next; + ListNode* newHead = tail->next; + tail->next = nullptr; + + return newHead; + } +}; From 367c0d2ca2a200e169b2b56d7e0fe68b401f2da8 Mon Sep 17 00:00:00 2001 From: Rakesh Roshan Date: Tue, 18 Oct 2022 19:18:31 +0530 Subject: [PATCH 40/75] 707. Design Linked List --- 707. Design Linked List.cpp | 83 +++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 707. Design Linked List.cpp diff --git a/707. Design Linked List.cpp b/707. Design Linked List.cpp new file mode 100644 index 0000000..745af7a --- /dev/null +++ b/707. Design Linked List.cpp @@ -0,0 +1,83 @@ +#include + +using namespace std; + +class MyLinkedList { + +private: + class Node{ + public: + int val; + Node* prev; + Node* next; + + Node(int val, Node* prev, Node* next): val(val), prev(prev), next(next){} + Node(int val): Node(val, NULL, NULL){} + }; + + Node* dummyHead; + +public: + /** Initialize your data structure here. */ + MyLinkedList() { + dummyHead = new Node(-1); + } + + /** Get the value of the index-th node in the linked list. If the index is invalid, return -1. */ + int get(int index) { + + Node* cur = dummyHead->next; + for(int i = 0; i < index && cur; i ++) + cur = cur->next; + + if(!cur) return -1; + return cur->val; + } + + /** Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. */ + void addAtHead(int val) { + dummyHead->next = new Node(val, dummyHead, dummyHead->next); + } + + /** Append a node of value val to the last element of the linked list. */ + void addAtTail(int val) { + + Node* pre = dummyHead; + while(pre->next) + pre = pre->next; + pre->next = new Node(val, pre, NULL); + } + + /** Add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. */ + void addAtIndex(int index, int val) { + + Node* pre = dummyHead; + for(int i = 0; i < index && pre; i ++) + pre = pre->next; + + if(pre) + pre->next = new Node(val, pre, pre->next); + } + + /** Delete the index-th node in the linked list, if the index is valid. */ + void deleteAtIndex(int index) { + + Node* pre = dummyHead; + for(int i = 0; i < index && pre; i ++) + pre = pre->next; + + if(pre && pre->next){ + Node* delNode = pre->next; + pre->next = delNode->next; + if(pre->next) + pre->next->prev = pre; + delete delNode; + } + } +}; + + +int main() { + + return 0; +} From 20973f7e25d1c89a2ef3c6fccfecc878b5511050 Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Tue, 18 Oct 2022 23:33:04 +0530 Subject: [PATCH 41/75] Add files via upload --- balancedParenthesis.cpp | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 balancedParenthesis.cpp diff --git a/balancedParenthesis.cpp b/balancedParenthesis.cpp new file mode 100644 index 0000000..bd4dc48 --- /dev/null +++ b/balancedParenthesis.cpp @@ -0,0 +1,60 @@ +#include +#include +using namespace std; + +bool isValid(string s){ + int n = s.size(); + + stack st; + bool ans = true; + for(int i=0; i Date: Tue, 18 Oct 2022 23:36:53 +0530 Subject: [PATCH 42/75] Add files via upload --- QueueUsingTwoStacks.cpp | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 QueueUsingTwoStacks.cpp diff --git a/QueueUsingTwoStacks.cpp b/QueueUsingTwoStacks.cpp new file mode 100644 index 0000000..7db8250 --- /dev/null +++ b/QueueUsingTwoStacks.cpp @@ -0,0 +1,55 @@ +#include +#include +using namespace std; + +class que{ + stack s1; + stack s2; + + public: + void push(int x){ + s1.push(x); + } + + int pop(){ + if(s1.empty() and s2.empty()){ + cout<<"Queue is empty"< Date: Tue, 18 Oct 2022 23:42:38 +0530 Subject: [PATCH 43/75] Add files via upload --- mergeTwoSortedll.cpp | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 mergeTwoSortedll.cpp diff --git a/mergeTwoSortedll.cpp b/mergeTwoSortedll.cpp new file mode 100644 index 0000000..dd0fa80 --- /dev/null +++ b/mergeTwoSortedll.cpp @@ -0,0 +1,106 @@ +#include +using namespace std; + +class node{ + public: + int data; + node* next; + node* prev; + + node(int val){ + data = val; + next = NULL; + prev = NULL; + } +}; + +void insertAtHead(node* &head, int val){ + node* n = new node(val); + n->next = head; + if(head!=NULL){ + head->prev = n; + } + + head = n; +} + +void insertAtTail(node* &head, int val){ + if(head==NULL){ + insertAtHead(head, val); + return; + } + + node* n = new node(val); + node* temp = head; + + while(temp->next!=NULL){ + temp = temp->next; + } + + temp->next = n; + n->prev = temp; +} + +node* merge(node* &head1, node* &head2){ + node* p1 = head1; + node* p2 = head2; + node* dummyNode = new node(-1); + node* p3 = dummyNode; + + while(p1!=NULL && p2!=NULL){ + if(p1->datadata){ + p3->next = p1; + p1 = p1->next; + } + else{ + p3->next = p2; + p2 = p2->next; + } + p3 = p3->next; + } + + while(p1!=NULL){ + p3->next = p1; + p1 = p1->next; + p3 = p3->next; + } + + while(p2!=NULL){ + p3->next = p2; + p2 = p2->next; + p3 = p3->next; + } + return dummyNode->next; +} + +void display(node *head){ + node* temp = head; + while(temp!=NULL){ + cout<data<<"->"; + temp = temp->next; + } + cout<<"NULL"< Date: Wed, 19 Oct 2022 08:35:21 +0530 Subject: [PATCH 44/75] Richest Customer python solution added --- 1372-RichestCustomerWealth.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 1372-RichestCustomerWealth.py diff --git a/1372-RichestCustomerWealth.py b/1372-RichestCustomerWealth.py new file mode 100644 index 0000000..3df8c13 --- /dev/null +++ b/1372-RichestCustomerWealth.py @@ -0,0 +1,13 @@ +class Solution: + def maximumWealth(self, accounts: List[List[int]]) -> int: + maxSum = 0 + for row in range(len(accounts)): + runningSum = 0 + for col in range(len(accounts[row])): + runningSum =runningSum+ accounts[row][col] + + if runningSum>maxSum: + maxSum = runningSum + return(maxSum) + + \ No newline at end of file From 44bb25f7a6a9f60e13526b7819f55b765399e6f3 Mon Sep 17 00:00:00 2001 From: unordered999stack <91750706+unordered999stack@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:24:03 +0530 Subject: [PATCH 45/75] Created search_element_in_row_column_sorted_matrix.cpp CPP Code to search an element in row-wise and column-wise sorted matrix --- ...ch_element_in_row_column_sorted_matrix.cpp | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 74. search_element_in_row_column_sorted_matrix.cpp diff --git a/74. search_element_in_row_column_sorted_matrix.cpp b/74. search_element_in_row_column_sorted_matrix.cpp new file mode 100644 index 0000000..30a72aa --- /dev/null +++ b/74. search_element_in_row_column_sorted_matrix.cpp @@ -0,0 +1,46 @@ +// C++ program to search an element in row-wise +// and column-wise sorted matrix +#include + +using namespace std; + +int search(int mat[4][4], int n, int x) +{ + if (n == 0) + return -1; + + int smallest = mat[0][0], largest = mat[n - 1][n - 1]; + if (x < smallest || x > largest) + return -1; + + int i = 0, j = n - 1; + while (i < n && j >= 0) + { + if (mat[i][j] == x) + { + cout << "n Found at " + << i << ", " << j; + return 1; + } + if (mat[i][j] > x) + j--; + + else + i++; + } + + cout << "n Element not found"; + return 0; +} + +// Driver code +int main() +{ + int mat[4][4] = { { 10, 20, 30, 40 }, + { 15, 25, 35, 45 }, + { 27, 29, 37, 48 }, + { 32, 33, 39, 50 } }; + search(mat, 4, 29); + + return 0; +} From 3d97a9d590786e401849af5f4e2b2c21d70d73f1 Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:04:46 +0530 Subject: [PATCH 46/75] Add files via upload --- Kth_Smallest_Element_in_BST.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Kth_Smallest_Element_in_BST.cpp diff --git a/Kth_Smallest_Element_in_BST.cpp b/Kth_Smallest_Element_in_BST.cpp new file mode 100644 index 0000000..04b72e2 --- /dev/null +++ b/Kth_Smallest_Element_in_BST.cpp @@ -0,0 +1,26 @@ +class Solution { +public: + int solve(TreeNode* root, int &i, int k){ + //base case + if(root == NULL){ + return -1; + } + + int left = solve(root -> left, i, k); + if(left != -1){ + return left; + } + + i++; + if(i == k){ + return root -> val; + } + return solve(root -> right, i, k); + } + + int kthSmallest(TreeNode* root, int k) { + int i = 0; + int ans = solve(root, i, k); + return ans; + } +}; \ No newline at end of file From 1ddb206a965aee22aee8b9192a36917fa57f360f Mon Sep 17 00:00:00 2001 From: unordered999stack <91750706+unordered999stack@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:24:16 +0530 Subject: [PATCH 47/75] Created k_freq_words.cpp Given an array of strings words and an integer k, return the k most frequent strings. --- 692. Top K Frequent Words/k_freq_words.cpp | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 692. Top K Frequent Words/k_freq_words.cpp diff --git a/692. Top K Frequent Words/k_freq_words.cpp b/692. Top K Frequent Words/k_freq_words.cpp new file mode 100644 index 0000000..8a2695a --- /dev/null +++ b/692. Top K Frequent Words/k_freq_words.cpp @@ -0,0 +1,35 @@ + +class Solution { +public: + vector topKFrequent(vector& words, int k) { + unordered_map hashmap; + for(string& word : words) { + hashmap[word] += 1; + } + priority_queue, vector>, MyComp> pq; + for(auto it = hashmap.begin(); it != hashmap.end(); ++it) { + pq.push(make_pair(it->second, it->first)); + if(pq.size() > k) pq.pop(); + } + vector res; + while(!pq.empty()) { + // res.insert(res.begin(), pq.top().second); + res.push_back(pq.top().second); // push the results in increasing, and reverse later + pq.pop(); + } + reverse(res.begin(), res.end()); + return res; + } +private: + struct MyComp { + bool operator() (const pair& a, const pair& b) { + if(a.first != b.first) { + return a.first > b.first; + } + else { + return a.second < b.second; + } + } + }; +}; + From 9dc4083a15027025b53cbc51b3923469dd37a2ab Mon Sep 17 00:00:00 2001 From: Akshay Soni <109035961+akshaysoni10@users.noreply.github.com> Date: Thu, 20 Oct 2022 11:38:18 +0530 Subject: [PATCH 48/75] Add files via upload --- Reverse_Vowels_Of_String.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Reverse_Vowels_Of_String.cpp diff --git a/Reverse_Vowels_Of_String.cpp b/Reverse_Vowels_Of_String.cpp new file mode 100644 index 0000000..5e53200 --- /dev/null +++ b/Reverse_Vowels_Of_String.cpp @@ -0,0 +1,26 @@ +class Solution { +public: + bool isVowel(char c){ + return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U'); + } + + string reverseVowels(string s) { + int n = s.length(); + int st = 0; + int e = n-1; + while(st Date: Fri, 21 Oct 2022 19:07:32 +0530 Subject: [PATCH 49/75] leetcode C# problem --- create two-sum.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 create two-sum.cs diff --git a/create two-sum.cs b/create two-sum.cs new file mode 100644 index 0000000..2b95fda --- /dev/null +++ b/create two-sum.cs @@ -0,0 +1,12 @@ +public class Solution { + public int[] TwoSum(int[] nums, int target) { + Dictionary lookup = new Dictionary(); + for (var i = 0; i < nums.Length; i++) { + if (lookup.ContainsKey(target - nums[i])) { + return new int [] { lookup[target - nums[i]], i }; + } + lookup[nums[i]] = i; + } + return new int[] { }; + } +} From efa9b2f7368b395f519ca8e4e2f721152db5ac9a Mon Sep 17 00:00:00 2001 From: Siya Pandey <85756788+siyapandeyvsp@users.noreply.github.com> Date: Fri, 21 Oct 2022 19:10:29 +0530 Subject: [PATCH 50/75] Create sum-with-multiplicity --- sum-with-multiplicity | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sum-with-multiplicity diff --git a/sum-with-multiplicity b/sum-with-multiplicity new file mode 100644 index 0000000..d41813d --- /dev/null +++ b/sum-with-multiplicity @@ -0,0 +1,25 @@ +# Time: O(n^2), n is the number of disctinct A[i] +# Space: O(n) + +import collections +import itertools + + +class Solution(object): + def threeSumMulti(self, A, target): + """ + :type A: List[int] + :type target: int + :rtype: int + """ + count = collections.Counter(A) + result = 0 + for i, j in itertools.combinations_with_replacement(count, 2): + k = target - i - j + if i == j == k: + result += count[i] * (count[i]-1) * (count[i]-2) // 6 + elif i == j != k: + result += count[i] * (count[i]-1) // 2 * count[k] + elif max(i, j) < k: + result += count[i] * count[j] * count[k] + return result % (10**9 + 7) From 81090a36dd37a0eed6ec6fd37e07672cb33b1238 Mon Sep 17 00:00:00 2001 From: Siya Pandey <85756788+siyapandeyvsp@users.noreply.github.com> Date: Fri, 21 Oct 2022 19:11:05 +0530 Subject: [PATCH 51/75] Create sum-with-multiplicity --- sum-with-multiplicity | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sum-with-multiplicity diff --git a/sum-with-multiplicity b/sum-with-multiplicity new file mode 100644 index 0000000..d41813d --- /dev/null +++ b/sum-with-multiplicity @@ -0,0 +1,25 @@ +# Time: O(n^2), n is the number of disctinct A[i] +# Space: O(n) + +import collections +import itertools + + +class Solution(object): + def threeSumMulti(self, A, target): + """ + :type A: List[int] + :type target: int + :rtype: int + """ + count = collections.Counter(A) + result = 0 + for i, j in itertools.combinations_with_replacement(count, 2): + k = target - i - j + if i == j == k: + result += count[i] * (count[i]-1) * (count[i]-2) // 6 + elif i == j != k: + result += count[i] * (count[i]-1) // 2 * count[k] + elif max(i, j) < k: + result += count[i] * count[j] * count[k] + return result % (10**9 + 7) From a7cdc8f9638f0930834b5aab970974819ff2623f Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Fri, 21 Oct 2022 22:09:00 +0530 Subject: [PATCH 52/75] c++ code solution for array recovery question --- ....cpp_7b3b9871d14eed2f4ce9e9619c6c4e79.prob | 1 + arrayrecovery.cpp | 66 ++++++++++++++++++ arrayrecovery.exe | Bin 0 -> 60278 bytes 3 files changed, 67 insertions(+) create mode 100644 .cph/.arrayrecovery.cpp_7b3b9871d14eed2f4ce9e9619c6c4e79.prob create mode 100644 arrayrecovery.cpp create mode 100644 arrayrecovery.exe diff --git a/.cph/.arrayrecovery.cpp_7b3b9871d14eed2f4ce9e9619c6c4e79.prob b/.cph/.arrayrecovery.cpp_7b3b9871d14eed2f4ce9e9619c6c4e79.prob new file mode 100644 index 0000000..f8f73be --- /dev/null +++ b/.cph/.arrayrecovery.cpp_7b3b9871d14eed2f4ce9e9619c6c4e79.prob @@ -0,0 +1 @@ +{"name":"Local: arrayrecovery","url":"c:\\Users\\CC\\Desktop\\git-anurag\\git-akpro\\leetcode-solutions-1\\arrayrecovery.cpp","tests":[{"id":1666365548858,"input":"","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"c:\\Users\\CC\\Desktop\\git-anurag\\git-akpro\\leetcode-solutions-1\\arrayrecovery.cpp","group":"local","local":true} \ No newline at end of file diff --git a/arrayrecovery.cpp b/arrayrecovery.cpp new file mode 100644 index 0000000..d0649ae --- /dev/null +++ b/arrayrecovery.cpp @@ -0,0 +1,66 @@ +// shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for (int i = n - 1; i >= 0; i--) +#define rep(i, n) for (int i = 0; i < n; i++) +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + +int main() +{ + int t; + cin >> t; + while (t--) + { + int n; + cin >> n; + int c = 0; + vector a(n); + vector b(n); + int flag = 0; + for (int i = 0; i < n; i++) + { + cin >> a[i]; + } + b[0] = a[0]; + for (int i = 1; i < n; i++) + { + if(a[i]==0){ + b[i] = b[i-1] + a[i]; + continue; + } + if (b[i-1] - a[i] >= 0) + { + flag = 1; + break; + } + else{ + b[i] = a[i] + b[i - 1]; + } + } + for (int i = 0; i < n; i++) + { + if (flag == 0) + { + cout << b[i] << " "; + } + else{ + cout << "-1"; + break; + } + } + cout<Y!0UAtVqGG-yIHA(7n7g^PllNiu=a+|2CZq9UP_ zSmsRALwo3{{px8!Y)gA=OV9BjZ7C-ZOi-ytq)H35QK_96YH5oYE_J^Dv(~=M&g9nq z`kwdu-nSce_Fm6=ZtGdkde&{v-bD{?XBNho6=yii*nV8;$l`xT{?mf&gqwbnz+N2x z^J)7{g+HHGvCiXlG&MJ_ZFbc=s$C5Yjk2T4?P&HjI6MuG+>&xfePfL~^{T5Tq$sRQ zos1Qlu3{bg%c|MajO9X^UKVSLGnuEd`9NBQ(+t=|ToZAY;w0_p9&pmzgp;oPNJ9#V zN0UsvT#PvcE)ft74&@>eJHgT>ZvU3Q)(*y|3_-YK7h_XNv0;u>*}YLl-m@9_Lkdw@ zwL;(?#~N0;Cbh;TyKq010HrulW_C9v^dpOx1@Umu;JRC13 z;ZGAzvTGL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P+P-LS+$E`SyAVO%FAfP%=N*KL+ick@v>dX z1@5%Hs>m+T7C&;Du?&J1R*uz06o$xh-F0XPLu5!`)a2zZqKH=ci3dGUS(wt$#|>Q7 zFbVciJ=I?Br~JE*jkTmNHYD-=f_m)Ck^>tv@Wmc?Gd|QxIs8M+G@PUwy$qWKv;|5HoYQ&lhVvUFsv=~()oTwTE#%sG)IDV~wxQozI;zTeOKmkwEb)a)!pb8gc{O z9oC_hN#ZxeEOmq1^=K-bZwPt##DupQ#)~d5> zY9Pc*!7dtt?vmV$zVNHWBjFAks2f3V(BD`crUZvjF=It5F0MYYUPx^RAcF*e4bRgw3@_l|HCQ*e_B!W0npWr;5Dq9iAce_ACT1* zRF6$Az6pyR2`simh}GR*tu}l@p&DxazolK+7*8;iOKIb@flqZTcyx7i<;t0xg(N!-%7E2&>^|%@K*t^5=_2V?2 zc)y)}+?P+YPKfCb`$~W@>y^3ypZ$?E9Do1b)JvAhq;=jh#k)Ei+MqGufhRf86K2YV zq_1xxbQW@VQ5x<_OAK#43}ELRzXxIVcNbMg z$C`eFNdlpZ?@nP^uu5M*q30S`+wn%3XL|BDwhz{giv4uXZwr*0RA;@=b#{#_%$EaB zlsvaX2?PqH8KLql49CU44jdz1qHR0VQK8bxVub{u1|;{F08d2mZXOecH!!j*%i>&3 zN8>XR?)Nu&ifzgawQEcNLI{b83)wSbD!Ox>is}0LEJ~0Es%HhHY+uu?^X-NN@9IXn z2YtF%3y~*qRT2Sky9Jw-*r7K&H+8sy4sUB9cg=NZdXxax_|bxni9LS+P$@RAG Date: Fri, 21 Oct 2022 22:55:28 +0530 Subject: [PATCH 53/75] c++ code solution for palindrome partition --- palindromepartition.cpp | 83 ++++++++++++++++++++++++++++++++++++++++ palindromepartition.exe | Bin 0 -> 73418 bytes 2 files changed, 83 insertions(+) create mode 100644 palindromepartition.cpp create mode 100644 palindromepartition.exe diff --git a/palindromepartition.cpp b/palindromepartition.cpp new file mode 100644 index 0000000..0699248 --- /dev/null +++ b/palindromepartition.cpp @@ -0,0 +1,83 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + ll n; + cin>>n; + string as; + cin>>as; + if(as[0]=='0'){ + for (int i = 0; i < 2*n; i++) + { + if(as[i]=='1'){ + as[i]='0'; + } + else{ + as[i]='1'; + } + } + + } + vector vc; + ll cc; + ll flag = 0; + ll an; + for (int i = 0; i < 2*n; i++) + { + if(as[i]=='0'){ + vc.push_back(i); + } + if(as[i] != as[2*n-i-1]){ + flag=1; + break; + } + } + if(flag){ + cout<<"1\n"; + cout<<2*n<=1; i--){ + if(vc[i]-vc[i-1]-1!=cc){ + flag=1; + cout<<"2\n"; + cout<o*3-N&j zcVpSE=}lX0y)A8dwWY1Mr7cCYlm-$LP^uBBQlVZ{)J>Dx)FMVu_xJgpdF^BZ;rhS- z*S!u*X6AFguk$_M^F3$I%jqjTV7w}73Fd`rR=E=qnU z@Om+3muQKBc(BO_>0&EmrDLVjFY?#Y!C3qVjQh7SmPLkLWJ?rX%_7QD)9{B3qPnV; zz&W;6tY}qYWw}_6^T`AhVMm?W0=m$)be7bS*eDSukc?H>!?9;!57|JMJ}X56qOQcT z0XrFgr-Uhgi7s(OpNA zvT-`Gmg}_>-hrLy$j*?B=w>BL6-gz$7dz24(uKCAv-AbCX3yh5kQ{g#`&Y2@O5rGP z=`3c!tdwMaHH)_y{*b(HDHPI?)6JQ~FAfu3j7;~$2y}CA;UKrqF4KKyI9<{LJ@Wtj zm1khGKP$oRXMQ&SoACJhg86MYG_9H+hJ&s3C`{_f;!(wVED4dg474OM<{1)f-W=4c z6-4g?ZQFA_S)bhD>6(1V!rJ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|YK|He)qYlN=z+vq26C%SCkey$;WN#$`(7u+&$0pMm(V PG@X9M$nc$L5z7Aq)HPnR literal 0 HcmV?d00001 From 28acfe361555f8edf37e4fd91e2f34bf59a99c5b Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Fri, 21 Oct 2022 23:21:19 +0530 Subject: [PATCH 54/75] c++ code solution for binary substitution --- binarysubstituition.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 binarysubstituition.cpp diff --git a/binarysubstituition.cpp b/binarysubstituition.cpp new file mode 100644 index 0000000..d4d0d89 --- /dev/null +++ b/binarysubstituition.cpp @@ -0,0 +1,48 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + string a; + cin>>a; + cout<<(solve(a,0))/(a.length())< Date: Fri, 21 Oct 2022 23:30:51 +0530 Subject: [PATCH 55/75] c++ code solution for binary substituition --- binarysubstituition.cpp => binarysubtitution1.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename binarysubstituition.cpp => binarysubtitution1.cpp (100%) diff --git a/binarysubstituition.cpp b/binarysubtitution1.cpp similarity index 100% rename from binarysubstituition.cpp rename to binarysubtitution1.cpp From cbbb8347f95a39e2f9bdf88cf3b6edfac1545485 Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Fri, 21 Oct 2022 23:42:14 +0530 Subject: [PATCH 56/75] c++ code solution for confusing concatenations --- binarysubtitution1.cpp | 48 ------------------------------------- confusingconcatenations.cpp | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 48 deletions(-) delete mode 100644 binarysubtitution1.cpp create mode 100644 confusingconcatenations.cpp diff --git a/binarysubtitution1.cpp b/binarysubtitution1.cpp deleted file mode 100644 index d4d0d89..0000000 --- a/binarysubtitution1.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//shree ganeshay namah -#include -using namespace std; -#define ll long long -#define pi (3.141592653589) -#define mod 1000000007 -#define ll long long -#define float double -#define pb push_back -#define mp make_pair -#define ff first -#define ss second -#define all(c) c.begin(), c.end() -#define min3(a, b, c) min(c, min(a, b)) -#define min4(a, b, c, d) min(d, min(c, min(a, b))) -#define rrep(i, n) for(int i=n-1;i>=0;i--) -#define rep(i,n) for(int i=0;i>t; - while(t--) - { - string a; - cin>>a; - cout<<(solve(a,0))/(a.length())< +using namespace std; +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + + +int main() +{ + + + int tt; + cin>>tt; + while(tt--) + { + int n; + cin>>n; + + int a[n]; + for (int i = 0; i < n; i++) + { + cin>>a[i]; + } + int max1 = 0; + for (int i = 0; i < n; i++) + { + if(a[i]>a[max1]) + max1 = i; + } + if(max1 == 0){ + cout<<-1< Date: Fri, 21 Oct 2022 23:51:14 +0530 Subject: [PATCH 57/75] c++ code solution for subsequence --- subsequence.cpp | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 subsequence.cpp diff --git a/subsequence.cpp b/subsequence.cpp new file mode 100644 index 0000000..a643529 --- /dev/null +++ b/subsequence.cpp @@ -0,0 +1,92 @@ +#include +using namespace std; + +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ss second +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i vi; +typedef vector> vpi; +typedef vector vl; +#define all(aa) aa.begin(), aa.end() +#define pb push_back + +#define ff \ + ios_base::sync_with_stdio(false); \ + cin.tie(NULL); \ + cout.tie(NULL); + +#define t \ + int test_cases; \ + cin >> test_cases; \ + while (test_cases--) + + +int main() +{ + ff + + t{ + ll n, anurag = 0; + cin >> n; + vl aa, aa1, mohit; + for (ll i = 0; i < n; i++) + { + ll a; + cin >> a; + + if (i % 2 == 0){ + aa.pb(a); + } + else{ + aa1.pb(a); + } + + } + + sort(all(aa), greater()); + sort(all(aa1)); + + ll a = 0, b = 0; + for (ll i = 0; i < n; i++) + { + if (i % 2 == 0) + { + mohit.pb(aa[a]); + a++; + } + else + { + mohit.pb(aa1[b]); + b++; + } + } + + if (aa1.size() > 1) + for (ll i = aa1.size() - 2; i >= 0; i--) + { + aa1[i] += aa1[i + 1]; + } + + for (ll i = 0; i < aa.size() && i < aa1.size(); i++) + { + anurag += aa[i] * aa1[i]; + } + + for (auto i : mohit) + cout << i << " "; + + cout << "\n" << anurag << "\n"; + } + return 0; +} \ No newline at end of file From 2ebf8692968cb0473c22d054206856eb4eb47bec Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Fri, 21 Oct 2022 23:56:34 +0530 Subject: [PATCH 58/75] c++ code solution for average flex --- averageflex.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 averageflex.cpp diff --git a/averageflex.cpp b/averageflex.cpp new file mode 100644 index 0000000..18812cb --- /dev/null +++ b/averageflex.cpp @@ -0,0 +1,54 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + int n, cv = 0, qw = 0, po = 0; + cin >> n; + std::vector a(n); + for (int i = 0; i < n; i++) + cin >> a[i]; + for (int j = 0; j < n; j++) + { + for (int i = 0; i < n; i++) + { + if (a[j] >= a[i]){ + cv++; + } + else{ + qw++; + } + + } + if (cv > qw) + po++; + cv = 0; + qw = 0; + } + cout << po << endl; +} + return 0; +} From f6b4d6b4cb0f8636e0ac90f3e380efd14358b477 Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Sat, 22 Oct 2022 00:01:59 +0530 Subject: [PATCH 59/75] c++ code solution palindrome flipping --- palindromeflipping.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 palindromeflipping.cpp diff --git a/palindromeflipping.cpp b/palindromeflipping.cpp new file mode 100644 index 0000000..0147dbb --- /dev/null +++ b/palindromeflipping.cpp @@ -0,0 +1,53 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + int n; + cin>>n; + string as; + cin>>as; + int c1=0,c0=0; + for (int i = 0; i < n; i++) + { + if(as[i] == '1') + c1++; + else + c0++; + } + if(n%2==0){ + if(c1%2 && c0%2) + cout<<"NO"< Date: Sat, 22 Oct 2022 00:07:25 +0530 Subject: [PATCH 60/75] c++ code solution for paper cutting --- papercutting.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 papercutting.cpp diff --git a/papercutting.cpp b/papercutting.cpp new file mode 100644 index 0000000..cdf0714 --- /dev/null +++ b/papercutting.cpp @@ -0,0 +1,34 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + int ak,akg; + cin>>ak>>akg; + cout<<(ak/akg)*(ak/akg)< Date: Sat, 22 Oct 2022 00:13:08 +0530 Subject: [PATCH 61/75] c++ code solution for cowardly rooks --- cowardly rooks.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 cowardly rooks.cpp diff --git a/cowardly rooks.cpp b/cowardly rooks.cpp new file mode 100644 index 0000000..4599309 --- /dev/null +++ b/cowardly rooks.cpp @@ -0,0 +1,49 @@ +//shree ganeshay namah +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for(int i=n-1;i>=0;i--) +#define rep(i,n) for(int i=0;i>t; + while(t--) + { + int n,m; + cin>>n>>m; + vector> ma(m , vector (2)); + unordered_map mp; + unordered_map mq; + for (int i = 0; i < m; i++) + { + for (int j = 0; j < 2; j++) + { + cin>>ma[i][j]; + mp[ma[i][0]]++; + mq[ma[i][1]]++; + } + } + if(n == m) + cout<<"NO"< Date: Sat, 22 Oct 2022 00:19:10 +0530 Subject: [PATCH 62/75] c++ code solution for stripes --- stripes.cpp | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 stripes.cpp diff --git a/stripes.cpp b/stripes.cpp new file mode 100644 index 0000000..f423cc7 --- /dev/null +++ b/stripes.cpp @@ -0,0 +1,67 @@ + +#include +using namespace std; +#define ll long long +#define pi (3.141592653589) +#define mod 1000000007 +#define ll long long +#define float double +#define pb push_back +#define mp make_pair +#define ff first +#define ss second +#define all(c) c.begin(), c.end() +#define min3(a, b, c) min(c, min(a, b)) +#define min4(a, b, c, d) min(d, min(c, min(a, b))) +#define rrep(i, n) for (int i = n - 1; i >= 0; i--) +#define rep(i, n) for (int i = 0; i < n; i++) +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + +int main() +{ + int t; + cin >> t; + while (t--) + { + int red = 0, ak = 0; + string a[8]; + for (int i = 0; i < 8; i++) + { + cin >> a[i]; + } + int flag = 0; + for (int i = 0; i < 8; i++) + { + red = 0; + for (int j = 0; j < 8; j++) + { + if (a[i][j] == 'R') + red++; + } + if (red == 8) + { + cout << "R" << endl; + flag = 1; + break; + } + } + if (!flag) + { + for (int i = 0; i < 8; i++) + { + ak = 0; + for (int j = 0; j < 8; j++) + { + if (a[j][i] == 'B') + ak++; + } + if (ak == 8) + { + cout << "B" << endl; + break; + } + } + } + } + return 0; +} \ No newline at end of file From 540ee754e727cbf55f1e452cf50d5e4e1c71bbb8 Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Sat, 22 Oct 2022 00:24:32 +0530 Subject: [PATCH 63/75] c++ solution for funny permutation --- funny | 0 funnypermutation.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 funny create mode 100644 funnypermutation.cpp diff --git a/funny b/funny new file mode 100644 index 0000000..e69de29 diff --git a/funnypermutation.cpp b/funnypermutation.cpp new file mode 100644 index 0000000..1233d23 --- /dev/null +++ b/funnypermutation.cpp @@ -0,0 +1,42 @@ +#include +using namespace std; +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + + +int main() +{ + + + int ttt; + cin>>ttt; + while(ttt--) + { + int n1; + cin>>n1; + if(n1==3) + cout<<"-1"< anurag; i--) + { + cout<= 1; i--) + { + cout< Date: Sat, 22 Oct 2022 00:34:29 +0530 Subject: [PATCH 64/75] c++ solution for decode ways --- decodeways.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 decodeways.cpp diff --git a/decodeways.cpp b/decodeways.cpp new file mode 100644 index 0000000..8305ecf --- /dev/null +++ b/decodeways.cpp @@ -0,0 +1,50 @@ +class Solution { +public: + int numDecodings(string s) { + /*int n = s.size(); + int n1=0,n2=1,n3,ans; + for(int i=1;i<=n;i++){ + n3=n1+n2; + n1=n2; + n2=n3; + } + cout< Date: Tue, 25 Oct 2022 19:28:57 +0530 Subject: [PATCH 65/75] Create 34. Find First and Last Position of Element in Sorted Array.cpp --- ...st and Last Position of Element in Sorted Array.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 34. Find First and Last Position of Element in Sorted Array.cpp diff --git a/34. Find First and Last Position of Element in Sorted Array.cpp b/34. Find First and Last Position of Element in Sorted Array.cpp new file mode 100644 index 0000000..6449954 --- /dev/null +++ b/34. Find First and Last Position of Element in Sorted Array.cpp @@ -0,0 +1,10 @@ +class Solution { + public: + vector searchRange(vector& nums, int target) { + const int l = lower_bound(begin(nums), end(nums), target) - begin(nums); + if (l == nums.size() || nums[l] != target) + return {-1, -1}; + const int r = upper_bound(begin(nums), end(nums), target) - begin(nums) - 1; + return {l, r}; + } +}; From df65592548dd501621af5469af7b524a91487794 Mon Sep 17 00:00:00 2001 From: Rakesh Roshan Date: Tue, 25 Oct 2022 19:31:45 +0530 Subject: [PATCH 66/75] Create 43. Multiply Strings.cpp --- 43. Multiply Strings.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 43. Multiply Strings.cpp diff --git a/43. Multiply Strings.cpp b/43. Multiply Strings.cpp new file mode 100644 index 0000000..1159873 --- /dev/null +++ b/43. Multiply Strings.cpp @@ -0,0 +1,17 @@ +class Solution { + public: + string multiply(string num1, string num2) { + string s(num1.length() + num2.length(), '0'); + + for (int i = num1.length() - 1; i >= 0; --i) + for (int j = num2.length() - 1; j >= 0; --j) { + const int mult = (num1[i] - '0') * (num2[j] - '0'); + const int sum = mult + (s[i + j + 1] - '0'); + s[i + j] += sum / 10; + s[i + j + 1] = '0' + sum % 10; + } + + const int i = s.find_first_not_of('0'); + return i == -1 ? "0" : s.substr(i); + } +}; From 215ee8bff5659908d305e549784d9cbc8213e587 Mon Sep 17 00:00:00 2001 From: ragupathi09 <97830392+ragupathi09@users.noreply.github.com> Date: Tue, 25 Oct 2022 22:31:26 +0530 Subject: [PATCH 67/75] C++ Binary search --- C++/Binary_search.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 C++/Binary_search.cpp diff --git a/C++/Binary_search.cpp b/C++/Binary_search.cpp new file mode 100644 index 0000000..d39c299 --- /dev/null +++ b/C++/Binary_search.cpp @@ -0,0 +1,51 @@ +#include +using namespace std; +// recursive function for binary search +/* if match found then return index of search key + else return -1 */ +int binarySearch(int arr[], int low, int high, int key) { + if (high >= low) { + // find middle index + int mid = low + (high - low) / 2; + + // find middle term and compare + if (arr[mid] == key) return mid; // key found + + // If key is smaller than middle term, then + // it can only be present in left subarray + if (arr[mid] > key) + return binarySearch(arr, low, mid - 1, key); + + // Else the key can only be present + // in right subarray + return binarySearch(arr, mid + 1, high, key); + } + + // key not found + return -1; +} + +// main function +int main() +{ + int array[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; + int key = 0; + + // take input for the search key + cout << "Enter Search Element: "; + cin >> key; + + // find the size array + int size = sizeof(array)/sizeof(array[0]); + + // search key + int index = binarySearch(array, 0, size, key); + + // display result + if(index == -1) + cout << key << " Not Found" << endl; + else + cout << key << " Found at Index = " << index << endl; + + return 0; +} From f7f7f0ec18b1d90d667faf316d2a05497ba4b438 Mon Sep 17 00:00:00 2001 From: ragupathi09 <97830392+ragupathi09@users.noreply.github.com> Date: Wed, 26 Oct 2022 13:27:41 +0530 Subject: [PATCH 68/75] Create Factorial_recursion.cpp --- C++/Factorial_recursion.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 C++/Factorial_recursion.cpp diff --git a/C++/Factorial_recursion.cpp b/C++/Factorial_recursion.cpp new file mode 100644 index 0000000..e7dd570 --- /dev/null +++ b/C++/Factorial_recursion.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; + +int factorial(int); + +int main() { + int n, result; + + cout << "Enter a non-negative number: "; + cin >> n; + + result = factorial(n); + cout << "Factorial of " << n << " = " << result; + return 0; +} + +int factorial(int n) { + if (n > 1) { + return n * factorial(n - 1); + } else { + return 1; + } +} From 05ae9b501be3fb3982e1654f3479c663af2ed305 Mon Sep 17 00:00:00 2001 From: bilwa496 <66560100+bilwa496@users.noreply.github.com> Date: Wed, 26 Oct 2022 23:34:39 +0530 Subject: [PATCH 69/75] Created search_element_in_row_column_sorted_matrix.cpp CPP Code to search an element in row-wise and column-wise sorted matrix --- ...ch_element_in_row_column_sorted_matrix.cpp | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 74_search_element_in_row_column_sorted_matrix.cpp diff --git a/74_search_element_in_row_column_sorted_matrix.cpp b/74_search_element_in_row_column_sorted_matrix.cpp new file mode 100644 index 0000000..30a72aa --- /dev/null +++ b/74_search_element_in_row_column_sorted_matrix.cpp @@ -0,0 +1,46 @@ +// C++ program to search an element in row-wise +// and column-wise sorted matrix +#include + +using namespace std; + +int search(int mat[4][4], int n, int x) +{ + if (n == 0) + return -1; + + int smallest = mat[0][0], largest = mat[n - 1][n - 1]; + if (x < smallest || x > largest) + return -1; + + int i = 0, j = n - 1; + while (i < n && j >= 0) + { + if (mat[i][j] == x) + { + cout << "n Found at " + << i << ", " << j; + return 1; + } + if (mat[i][j] > x) + j--; + + else + i++; + } + + cout << "n Element not found"; + return 0; +} + +// Driver code +int main() +{ + int mat[4][4] = { { 10, 20, 30, 40 }, + { 15, 25, 35, 45 }, + { 27, 29, 37, 48 }, + { 32, 33, 39, 50 } }; + search(mat, 4, 29); + + return 0; +} From 5aa54edbace7275a736ae933e2af37551cfedbd3 Mon Sep 17 00:00:00 2001 From: bilwa496 <66560100+bilwa496@users.noreply.github.com> Date: Fri, 28 Oct 2022 20:56:52 +0530 Subject: [PATCH 70/75] Created LRU_Cache.cpp Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. --- 146. LRU Cache/LRU_Cache.cpp | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 146. LRU Cache/LRU_Cache.cpp diff --git a/146. LRU Cache/LRU_Cache.cpp b/146. LRU Cache/LRU_Cache.cpp new file mode 100644 index 0000000..4165420 --- /dev/null +++ b/146. LRU Cache/LRU_Cache.cpp @@ -0,0 +1,51 @@ +// Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. + +struct Node { + int key; + int value; + Node(int key, int value) : key(key), value(value) {} +}; + + +class LRUCache { + public: + LRUCache(int capacity) : capacity(capacity) {} + + int get(int key) { + if (!keyToIterator.count(key)) + return -1; + + const auto& it = keyToIterator[key]; + // move it to the front + cache.splice(begin(cache), cache, it); + return it->value; + } + + void put(int key, int value) { + // no capacity issue, just update the value + if (keyToIterator.count(key)) { + const auto& it = keyToIterator[key]; + // move it to the front + cache.splice(begin(cache), cache, it); + it->value = value; + return; + } + + // check the capacity + if (cache.size() == capacity) { + const auto& lastNode = cache.back(); + // that's why we store `key` in `Node` + keyToIterator.erase(lastNode.key); + cache.pop_back(); + } + + cache.emplace_front(key, value); + keyToIterator[key] = begin(cache); + } + + private: + const int capacity; + list cache; + unordered_map::iterator> keyToIterator; +}; + From f8a22ebe55dd25cded9e04ea9946ab420a2624b5 Mon Sep 17 00:00:00 2001 From: Abhay7838 <116904108+Abhay7838@users.noreply.github.com> Date: Fri, 28 Oct 2022 21:22:30 +0530 Subject: [PATCH 71/75] Update 5.Longest_Palindrome_Substring.java --- 5.Longest_Palindrome_Substring.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/5.Longest_Palindrome_Substring.java b/5.Longest_Palindrome_Substring.java index fd4e0aa..b6274b1 100644 --- a/5.Longest_Palindrome_Substring.java +++ b/5.Longest_Palindrome_Substring.java @@ -5,7 +5,7 @@ public String longestPalindrome(String s) { // aba int len1 = expandAroundCenter(s, i, i); // bb - int len2 = expandAroundCenter(s, i, i + 1); + int len2 =expandAroundCenter(s, i, i + 1); int len = Math.max(len1, len2); if (len > end - start) { start = i - (len - 1) / 2; @@ -26,4 +26,4 @@ private int expandAroundCenter(String s, int left, int right) { - \ No newline at end of file + From 181fbe55ba3283928fd68b3429483a53550623bb Mon Sep 17 00:00:00 2001 From: Abhay7838 <116904108+Abhay7838@users.noreply.github.com> Date: Fri, 28 Oct 2022 21:27:10 +0530 Subject: [PATCH 72/75] Update 95. Unique Binary Search Trees II.cpp --- 95. Unique Binary Search Trees II.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/95. Unique Binary Search Trees II.cpp b/95. Unique Binary Search Trees II.cpp index 6838b5a..0f58099 100644 --- a/95. Unique Binary Search Trees II.cpp +++ b/95. Unique Binary Search Trees II.cpp @@ -13,7 +13,7 @@ class Solution { public: // Copied solution - vector generateTrees(int n, int s = 1) + vector generateTrees(int n, int s = 1) { vector ans; if (n < s) @@ -36,4 +36,4 @@ class Solution } return ans; } -}; \ No newline at end of file +}; From 9bd5a33c0a02fb6feba293eff6331e127098de30 Mon Sep 17 00:00:00 2001 From: Abhay7838 <116904108+Abhay7838@users.noreply.github.com> Date: Fri, 28 Oct 2022 21:33:12 +0530 Subject: [PATCH 73/75] Update Mirror Reflection.java --- Mirror Reflection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mirror Reflection.java b/Mirror Reflection.java index 80948c0..de53259 100644 --- a/Mirror Reflection.java +++ b/Mirror Reflection.java @@ -7,7 +7,7 @@ public int mirrorReflection(int p, int q) { } if(p%2==0 && q%2!=0){ - return 2; + return 2; } else if(p%2!=0 && q%2==0){ return 0; From 9ebee76e1e42685d927371127c076339a6e2303c Mon Sep 17 00:00:00 2001 From: Abhay7838 <116904108+Abhay7838@users.noreply.github.com> Date: Fri, 28 Oct 2022 21:36:42 +0530 Subject: [PATCH 74/75] Update stripes.cpp --- stripes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stripes.cpp b/stripes.cpp index f423cc7..a5e378c 100644 --- a/stripes.cpp +++ b/stripes.cpp @@ -23,7 +23,7 @@ int main() cin >> t; while (t--) { - int red = 0, ak = 0; + int red = 0, ak = 0; string a[8]; for (int i = 0; i < 8; i++) { @@ -64,4 +64,4 @@ int main() } } return 0; -} \ No newline at end of file +} From fcbe62ad0dd6696495805a87e1ed0e60f7dc2e26 Mon Sep 17 00:00:00 2001 From: bilwa496 <66560100+bilwa496@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:23:55 +0530 Subject: [PATCH 75/75] Created intersection-of-two-linked-lists.cpp intersection-of-two-linked-lists.cpp --- 160-intersection-of-two-linked-lists.cpp | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 160-intersection-of-two-linked-lists.cpp diff --git a/160-intersection-of-two-linked-lists.cpp b/160-intersection-of-two-linked-lists.cpp new file mode 100644 index 0000000..5252b66 --- /dev/null +++ b/160-intersection-of-two-linked-lists.cpp @@ -0,0 +1,26 @@ +// Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. +// If the two linked lists have no intersection at all, return null. + +// Time: O(m + n) +// Space: O(1) + +/** + * Definition for singly-linked list. + * struct ListNode { + * int val; + * ListNode *next; + * ListNode(int x) : val(x), next(NULL) {} + * }; + */ + +class Solution { +public: + ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { + ListNode *curA = headA, *curB = headB; + while (curA != curB) { + curA = curA ? curA->next : headB; + curB = curB ? curB->next : headA; + } + return curA; + } +};