-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ossamamehmood:main' into main
- Loading branch information
Showing
4,315 changed files
with
21,246 additions
and
270,640 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
boilerplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
boilerplate doe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
boilerplate c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
int main() | ||
{ | ||
int t; | ||
cin>>t; | ||
while (t--) | ||
{ | ||
int a,b,c,i,sum1,sum2; | ||
cin>>a>>b>>c; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
int main() | ||
{ | ||
int t; | ||
cin>>t; | ||
while (t--) | ||
{ | ||
int a,b,c,i,sum1,sum2; | ||
cin>>a>>b>>c; | ||
cout | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
int main() | ||
{ | ||
int t; | ||
cin>>t; | ||
while (t--) | ||
{ | ||
int a,b,c,i,sum1,sum2; | ||
cin>>a>>b>>c; | ||
cout<<max(a,max(b,c))<<endl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
int main() | ||
{ | ||
int t; | ||
cin>>t; | ||
while (t--) | ||
{ | ||
int a,b,c,i,sum1,sum2; | ||
cin>>a>>b>>c; | ||
cout<<max(a,max(b,c))<<endl; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//program for linear search | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int linearFunction(int linearArray[], int n, int key) | ||
{ | ||
for (int i = 0; i < n; i++) | ||
{ | ||
if (linearArray[i] == key) | ||
{ | ||
cout << "The index of that element is " << endl; | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
|
||
int main() | ||
{ | ||
int n; | ||
cout << "Enter the total elements " << endl; | ||
cin >> n; | ||
|
||
cout << "Put element in the array " << endl; | ||
int linearArray[100]; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
cin >> linearArray[i]; | ||
} | ||
|
||
int key; | ||
cout << "Enter the key element " << endl; | ||
cin >> key; | ||
cout << linearFunction(linearArray, n, key) << endl; | ||
// linearFunction(linearArray, n, key); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
void reverse(int arr[], int n) | ||
{ | ||
int start = 0; | ||
int end = n - 1; | ||
cout << "Your reverse list of array is " << endl; | ||
while (start <= end) | ||
{ | ||
swap(arr[start], arr[end]); | ||
start++; | ||
end--; | ||
} | ||
} | ||
|
||
void print(int arr[], int n) | ||
{ | ||
|
||
for (int i = 0; i < n; i++) | ||
{ | ||
cout << arr[i] << endl; | ||
} | ||
} | ||
|
||
int main() | ||
{ | ||
|
||
int n; | ||
cout << "Enter the number " << endl; | ||
cin >> n; | ||
|
||
int arr[20]; | ||
for (int i = 0; i < n; i++) | ||
{ | ||
cin >> arr[i]; | ||
} | ||
|
||
reverse(arr, n); | ||
print(arr, n); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include<iostream> | ||
using namespace std; | ||
|
||
void printArray(int array[], int size){ | ||
for (int i = 0; i < size; i++) | ||
{ | ||
cout << array[i] << endl; | ||
} | ||
|
||
} | ||
int main(){ | ||
int firstArr[10] = {0}; | ||
printArray(firstArr, 5); | ||
|
||
cout << "First array done " << endl; | ||
|
||
int secArray[4] = {1,2}; | ||
printArray(secArray, 4); | ||
|
||
cout << "Second array done " << endl; | ||
|
||
int thirdArray[4]; | ||
printArray(thirdArray, 4); | ||
|
||
|
||
int forArray[4] = {1,2,3,4,5}; | ||
printArray(forArray, 2); | ||
cout << "forth array done " << endl; | ||
|
||
// int n; | ||
// cin >> n; | ||
// for (int i = 0; i < n; i++) | ||
// { | ||
// cout << arr[i] << endl; | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* Given a boolean expression S of length N with following symbols. | ||
Symbols | ||
'T' ---> true | ||
'F' ---> false | ||
and following operators filled between symbols | ||
Operators & ---> boolean AND | ||
| ---> boolean OR | ||
^ ---> boolean XOR | ||
Count the number of ways we can parenthesize the expression so that the value of expression evaluates to true. | ||
Note: The answer can be large, so return it with modulo 1003 */ | ||
|
||
|
||
|
||
|
||
|
||
|
||
// User function Template for C++ | ||
|
||
class Solution{ | ||
public: | ||
unordered_map<string, int> map; | ||
|
||
int solve(string &s, int i, int j, bool isTrue){ | ||
if(i>j) return 0; | ||
if(i==j){ | ||
if(isTrue==true) return s[i]=='T'; | ||
else return s[i]=='F'; | ||
} | ||
|
||
string temp = to_string(i)+' '+to_string(j)+' '+to_string(isTrue); | ||
if(map.find(temp)!=map.end()) return map[temp]; | ||
|
||
int ans = 0; | ||
for(int k=i;k<=j-2;k+=2){ | ||
int lt = solve(s, i, k, true); | ||
int lf = solve(s, i, k, false); | ||
int rt = solve(s, k+2, j, true); | ||
int rf = solve(s, k+2, j, false); | ||
|
||
if(s[k+1]=='&'){ | ||
if(isTrue) ans += lt * rt; | ||
else ans += lt * rf + lf * rt + lf * rf; | ||
} | ||
else if(s[k+1]=='|'){ | ||
if(isTrue) ans += lt * rt + lf * rt + lt *rf; | ||
else ans += lf * rf; | ||
} | ||
else if(s[k+1]=='^'){ | ||
if(isTrue) ans += lf * rt + lt *rf; | ||
else ans += lf * rf + lt * rt; | ||
} | ||
} | ||
return map[temp] = ans%1003; | ||
} | ||
|
||
int countWays(int n, string &s){ | ||
map.clear(); | ||
return solve(s, 0, n-1, true); |
Binary file not shown.
Oops, something went wrong.