Skip to content

Commit

Permalink
Merge branch 'ossamamehmood:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushar-013 authored Oct 2, 2023
2 parents f848fa1 + 6f193fd commit 0ff947a
Show file tree
Hide file tree
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.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
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"
Binary file modified .github/logo.png
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.
1 change: 1 addition & 0 deletions Add Code Here/.history/.cpp_20230929222513
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
boilerplate
1 change: 1 addition & 0 deletions Add Code Here/.history/.cpp_20230929222519
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
boilerplate doe
1 change: 1 addition & 0 deletions Add Code Here/.history/.cpp_20230929222521
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
boilerplate c
12 changes: 12 additions & 0 deletions Add Code Here/.history/.cpp_20230929222523
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;
}
}
13 changes: 13 additions & 0 deletions Add Code Here/.history/.cpp_20230929222529
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
}
}
13 changes: 13 additions & 0 deletions Add Code Here/.history/.cpp_20230929222532
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;
}
}
13 changes: 13 additions & 0 deletions Add Code Here/.history/.cpp_20230929222535
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.
36 changes: 36 additions & 0 deletions Add Code Here/0.8_Linear_search_Array.cpp
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);
}
41 changes: 41 additions & 0 deletions Add Code Here/0.9_Reverse_arry.cpp
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);
}
37 changes: 37 additions & 0 deletions Add Code Here/Array_Function_Practice.cpp
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;
// }

}
58 changes: 58 additions & 0 deletions Add Code Here/Boolean-Parenthesization-pralinkhaira.cpp
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 removed Add Code Here/C#/CMS/.vs/CMS/v16/.suo
Binary file not shown.
Loading

0 comments on commit 0ff947a

Please sign in to comment.