diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6b19b25 Binary files /dev/null and b/.DS_Store differ diff --git a/FCFS/fcfs.py b/Algorithm/FCFS/fcfs.py similarity index 100% rename from FCFS/fcfs.py rename to Algorithm/FCFS/fcfs.py diff --git a/FCFS/question.txt b/Algorithm/FCFS/question.txt similarity index 100% rename from FCFS/question.txt rename to Algorithm/FCFS/question.txt diff --git a/Algorithm/Floodfill/Problem_statement.txt b/Algorithm/Floodfill/Problem_statement.txt new file mode 100644 index 0000000..f36d41a --- /dev/null +++ b/Algorithm/Floodfill/Problem_statement.txt @@ -0,0 +1,28 @@ +For those who don’t like regular images, ASCII Maps Inc. has created maps that are fully printable ASCII characters. Each map is a rectangular grid of lowercase English letters, where each letter stands for various locations. In particular, ‘w’ stands for water and the other 25 letters represent various different land locations. For this problem, we are interested in counting the number of bodies of water on a given ASCII map. A body of water is a maximal set of contiguous grid squares on the ASCII map where each square in the body of water shares a boundary with at least one other square in the body of water. Thus, for two grid squares to be part of the same body of water, one must be above, below, to the left, or to the right of the other grid square. +Input +The first line of input consists of two space separated integers, r (1=r=50) and c (1=c=50), the number of rows and columns, respectively for the input map. The next r lines will each contain c lowercase English letters, representing the corresponding row of the input map. + +Output +On a line by itself, output the number of bodies of water in the input map. + +Sample test case 1: + +Input: +5 6 +waaaww +wawawc +bbbbwc +wwwwww +dddddd + +Output: +3 + +Sample test case 2: +Input: +2 8 +wxwxwxwx +xwxwxwxw + +Output: +8 diff --git a/Algorithm/Floodfill/solution.java b/Algorithm/Floodfill/solution.java new file mode 100644 index 0000000..a043c94 --- /dev/null +++ b/Algorithm/Floodfill/solution.java @@ -0,0 +1,53 @@ +import java.util.Arrays; +import java.util.Scanner; + +public class water { +public static void main(String[] args){ +Scanner kb=new Scanner(System.in); +System.out.println("Enter the dimensions of the map:"); +int n=kb.nextInt(); +int m=kb.nextInt(); +System.out.println("Enter the map:"); +char[][] x=new char[n][m]; +for(int i=0;i=0&&r=0&&c= M or y < 0 or + y >= N or screen[x][y] != prevC or + screen[x][y] == newC): + return + + # Replace the color at (x, y) + screen[x][y] = newC + + # Recur for north, east, south and west + floodFillUtil(screen, x + 1, y, prevC, newC) + floodFillUtil(screen, x - 1, y, prevC, newC) + floodFillUtil(screen, x, y + 1, prevC, newC) + floodFillUtil(screen, x, y - 1, prevC, newC) + +# It mainly finds the previous color on (x, y) and +# calls floodFillUtil() +def floodFill(screen, x, y, newC): + prevC = screen[x][y] + floodFillUtil(screen, x, y, prevC, newC) + +# Driver Code +screen = [[1, 1, 1, 1, 1, 1, 1, 1], + [1, 1, 1, 1, 1, 1, 0, 0], + [1, 0, 0, 1, 1, 0, 1, 1], + [1, 2, 2, 2, 2, 0, 1, 0], + [1, 1, 1, 2, 2, 0, 1, 0], + [1, 1, 1, 2, 2, 2, 2, 0], + [1, 1, 1, 1, 1, 2, 1, 1], + [1, 1, 1, 1, 1, 2, 2, 1]] + +x = 4 +y = 4 +newC = 3 +floodFill(screen, x, y, newC) + +print ("Updated screen after call to floodFill:") +for i in range(M): + for j in range(N): + print(screen[i][j], end = ' ') + print() diff --git a/Algorithm/Josephus's Problem/josephus.java b/Algorithm/Josephus's Problem/josephus.java new file mode 100644 index 0000000..437582a --- /dev/null +++ b/Algorithm/Josephus's Problem/josephus.java @@ -0,0 +1,21 @@ +import java.io.*; +import java.util.Scanner; + +class Josephus { + +static int josephus(int n, int k) +{ +if (n == 1) + return 1; +else + return (josephus(n - 1, k) + k-1) % n + 1; +} + + public static void main(String[] args) +{ + Scanner s = new Scnner(System.in); +int n = s.nextInt(); +int k = s.nextInt(); +System.out.println("The chosen place is " + josephus(n, k)); +} +} \ No newline at end of file diff --git a/Algorithm/Josephus's Problem/question.txt b/Algorithm/Josephus's Problem/question.txt new file mode 100644 index 0000000..b90a2be --- /dev/null +++ b/Algorithm/Josephus's Problem/question.txt @@ -0,0 +1,5 @@ +There are n people standing in a circle waiting to be executed. The counting out begins at some point in the circle and proceeds around the circle in a fixed direction. In each step, a certain number of people are skipped and the next person is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom. Given the total number of persons n and a number k which indicates that k-1 persons are skipped and kth person is killed in circle. The task is to choose the place in the initial circle so that you are the last one remaining and so survive. + +Example, if n = 5 and k = 2, then the safe position is 3. Firstly, the person at position 2 is killed, then person at position 4 is killed, then person at position 1 is killed. Finally, the person at position 5 is killed. So the person at position 3 survives. + +If n = 7 and k = 3, then the safe position is 4. The persons at positions 3, 6, 2, 7, 5, 1 are killed in order, and person at position 4 survives. \ No newline at end of file diff --git a/Algorithm/Kadane's Algorithm/kadane.c b/Algorithm/Kadane's Algorithm/kadane.c new file mode 100644 index 0000000..4b19327 --- /dev/null +++ b/Algorithm/Kadane's Algorithm/kadane.c @@ -0,0 +1,37 @@ +#include +#include + +int maxSubarraySum(int a[], int l) { + int max = INT_MIN, max_here = 0; + + for (int i = 0; i < l; i++) { + max_here = max_here + a[i]; + if (max < max_here) max = max_here; + if (max_here < 0) max_here = 0; + } + + return max; +} + +// int maxSubarraySum(int a[], int l) { +// int max = a[0], max_here = a[0]; + +// for (int i = 0; i < l; i++) { +// if (max_here > 0) max_here += a[i]; +// else max_here = a[i]; +// if (max_here > max) max = max_here; +// } + +// return max; +// } + +int main(int argc, char *argv[]) { + int arr[] = {-2, -3, 4, -1, -2, 1, 5, -3}; + int l = sizeof(arr) / sizeof(int); + + int m = maxSubarraySum(arr, l); + + printf("%d is the max subarray sum\n", m); + + return 0; +} \ No newline at end of file diff --git a/Algorithm/Kadane's Algorithm/kadane.cpp b/Algorithm/Kadane's Algorithm/kadane.cpp new file mode 100644 index 0000000..0101507 --- /dev/null +++ b/Algorithm/Kadane's Algorithm/kadane.cpp @@ -0,0 +1,27 @@ +#include +#include +using namespace std; + +int maxSubarraySum(vector a, int l) { + int max = INT_MIN, max_here = 0; + + for (int i = 0; i < l; i++) { + max_here = max_here + a[i]; + if (max < max_here) max = max_here; + if (max_here < 0) max_here = 0; + } + + return max; +} + + +int main() { + vector arr({-2, -3, 4, -1, -2, 1, 5, -3}); + int l = arr.size(); + + int m = maxSubarraySum(arr, l); + + cout< +using namespace std; + +template +class LinearList{ + private: + int MaxSize; + Item *element; // 1D dynamic array + int len; + public: + /* Default constructor. + * Should create an empty list that not contain any elements*/ + LinearList() + { + element=nullptr; + len=0; + }; + + /* This constructor should create a list containing MaxSize elements. You can intialize the elements with any values.*/ + LinearList(const int& MaxListSize) + { + MaxSize=MaxListSize; + element = new Item[MaxSize]; + len=0; + /*for(int i=0;ik;i--) + { + element[i]=element[i-1]; + } + element[k]=x; + len=len+1; + }; + + +}; + +int main() +{ + LinearList a(250); + int k,n,i,j,temp; + cout << "Enter number of children: "; + cin >> n; + cout << "Enter elimination rule: "; + cin >> i; + for(j=0;j +using namespace std; + +char board[30][30]; + +void printBoard(char arr[][30], int n) { + for (int r = 0; r < n; ++r) { + for (int c = 0; c < n; ++c) { + cout << arr[r][c] << " " ; + } + cout << endl; + } +} + +void initialiseBoard(int n) { + for (int r = 0; r < n; ++r) { + for (int c = 0; c < n; ++c) { + board[r][c] = 'X'; + } + } +} + +bool canPlace(char board[][30], int N, int x, int y) +{ + //check the row if aqueen already exists + for (int r = 0; r < N; ++r) + { + if (board[r][y] == 'Q') + return false; + } + + int rInc[] = { -1, +1, +1, -1}; + int cInc[] = { -1, +1, -1, +1}; + //check diagonal if queen already exists + for (int dir = 0; dir < 4; ++dir) + { + int rowAdd = rInc[dir]; + int colAdd = cInc[dir]; + int r = x + rowAdd; + int c = y + colAdd; + //check that r c is within the board + while (r >= 0 && r < N && c >= 0 && c < N) + { + if (board[r][c] == 'Q') + return false; + r = r + rowAdd; + c = c + colAdd; + } + } + return true; +} + +bool nqueen(int r, int n) +{ + if (r == n)//base case if all queens are placed + { + return true; + } + //for every column, use hit and trial by placing a queen in the each cell of curr Row + for (int c = 0; c < n; ++c) + { + int x = r; + int y = c; + //check if queen can be placed on board[i][c] + if (canPlace(board, n, x, y)==true) + { + board[x][y] = 'Q'; //place queen in each column + bool isSuccessful = nqueen(r + 1, n); //recursion to place rest of queens + if (isSuccessful == true) + return true; + board[x][y] = 'X'; //else unmark the cell or backtrack + } + } + return false; //if queen cannot be placed in any row in this column then return false +} + +int main() +{ + int n; + cin >> n; + + initialiseBoard(n);//initialse all the board with X + bool isSuccessful = nqueen(0, n); + + if (isSuccessful) printBoard(board, n); + else cout << "Sorry man! You need to have a larger board!\n"; + + return 0; +} diff --git a/Array/Biggest_Sum_5_Consecutives_Integers/Biggest_Sum_5_Consecutives_Integers b/Array/Biggest_Sum_5_Consecutives_Integers/Biggest_Sum_5_Consecutives_Integers new file mode 100644 index 0000000..b526a8c --- /dev/null +++ b/Array/Biggest_Sum_5_Consecutives_Integers/Biggest_Sum_5_Consecutives_Integers @@ -0,0 +1,19 @@ +What's the biggest sum you can get from adding 5 consecutives integers in a array? + +Example: + Array = [1, 3, -2, 4, -9, 1, 4, 7] + Possibles Sums: + 1 + 3 + (-2) + 4 + (-9) = -3 + 3 + (-2) + 4 + (-9) + 1 = -3 + (-2) + 4 + (-9) + 1 + 4 = -2 + 4 + (-9) + 1 + 4 + 7 = 7 + + So the biggest Sum is 7. + +What's the biggest sum of 5 consecutives integers of the array below? + +Array = [1, 3, -5, 8, -9, 13, -2, -3, 8, 4, 3, 6, 1, 2, -2, -4, 8, -4, 1, 8, 2, 1, 3, 1, 2, 3, + 7, 8, -9, 5, 4, 3, 2, 4, 1, 2, 6, 6, 7, -15, 9, 7, 8, 16, -10, 1, 2, 6, 6, 4, -5, 2, 2 + 3, 6, 7, 8, 1, 2, 3, 3, 4, 5, 6, 1, -5,7, -9, 10, 1, 3, 4, 8, 7, 6, 4, 1, 1, 2, 3, 1] + +PS: There may or may not have different sequences that has the same sum. diff --git a/Array/Biggest_Sum_5_Consecutives_Integers/solution.c b/Array/Biggest_Sum_5_Consecutives_Integers/solution.c new file mode 100644 index 0000000..4a395d4 --- /dev/null +++ b/Array/Biggest_Sum_5_Consecutives_Integers/solution.c @@ -0,0 +1,23 @@ +#include +#include + +int main(){ + int i; + int size = 81; //SIZE OF THE ARRAY + int sum; + int biggestSum; + int array[] = {1, 3, -5, 8, -9, 13, -2, -3, 8, 4, 3, 6, 1, 2, -2, -4, 8, -4, 1, 8, 2, 1, 3, 1, 2, 3, 7, 8, -9, 5, 4, 3, 2, 4, 1, 2, 6, 6, 7, -15, 9, 7, 8, 16, -10, 1, 2, 6, 6, 4, -5, 2, 2, 3, 6, 7, 8, 1, 2, 3, 3, 4, 5, 6, 1, -5, 7, -9, 10, 1, 3, 4, 8, 7, 6, 4, 1, 1, 2, 3, 1}; + + //FIRST SUM + sum = array[0] + array[1] + array[2] + array[3] + array[4]; + biggestSum = sum; + + //OTHER SUMS + for(i = 1; i < (size - 4); i++){ //THERE ARE (size - 4) POSSIBLE SUMS, BUT WE ALREADY MADE 1, SO i STARTS AT 1 + sum = sum - array[i - 1] + array[i + 4]; //REMOVE THE FIRST OF THE OLD SUM, AND ADD THE NEW INTEGER + if(sum > biggestSum){ + biggestSum = sum; + } + } + printf("biggestSum = %d\n", biggestSum); //PRINT THE RESULT +} \ No newline at end of file diff --git a/Array/Circle Coloring/1408A.cpp b/Array/Circle Coloring/1408A.cpp new file mode 100644 index 0000000..d526a08 --- /dev/null +++ b/Array/Circle Coloring/1408A.cpp @@ -0,0 +1,52 @@ +#include + +using namespace std; + +int main() +{ + while() + { + int n; + cin>>n; + std::vector a(n), b(n), c(n), ans; + + for(int i=0; i>a[i]; + } + for(int i=0; i>b[i]; + } + for(int i=0; i>c[i]; + } + ans.push_back(a[0]); + + for(int i=1; i + +using namespace std; + +// Complete the hourglassSum function below. +int hourglassSum(vector> arr) { + + int sum[16]={0}; + int a[36]; + static int r=0,x=0; + + for(int i=0;i<6;i++){ + for(int j=0;j<6;j++,r++){ + a[r]=arr[i][j]; + } + } + + + for(int i=0;i<22;i++,x++){ + sum[x]=a[i]+a[i+1]+a[i+2]+a[i+7]+a[i+12]+a[i+13]+a[i+14]; + if(i==3 || i==9 || i==15) + i+=2; + cout << sum[x] << " "; + } + + int large = sum[0]; + + for(int i=1;i<16;i++){ + if(large> arr(6); + for (int i = 0; i < 6; i++) { + arr[i].resize(6); + + for (int j = 0; j < 6; j++) { + cin >> arr[i][j]; + } + + cin.ignore(numeric_limits::max(), '\n'); + } + + int result = hourglassSum(arr); + + fout << result << "\n"; + + fout.close(); + + return 0; +} \ No newline at end of file diff --git a/Lily's Homework/Question.txt b/Array/Lily's Homework/Question.txt similarity index 98% rename from Lily's Homework/Question.txt rename to Array/Lily's Homework/Question.txt index 502c95c..39f207f 100644 --- a/Lily's Homework/Question.txt +++ b/Array/Lily's Homework/Question.txt @@ -1,11 +1,11 @@ -Consider an array of distinct integers, arr = [a[0], a[1], ..., a[n-1]]. George can swap any two elements of the array any number of times. An array is beautiful if the sum of |arr[i] - arr[i-1]|among 0< i < n is minimal. - -Given the array , determine and return the minimum number of swaps that should be performed in order to make the array beautiful. - -For example, arr = [7, 15, 12, 3]. One minimal array is [3, 7, 12, 15]. To get there, George performed the following swaps: - -Swap Result - [7, 15, 12, 3] -3 7 [3, 15, 12, 7] -7 15 [3, 7, 12, 15] +Consider an array of distinct integers, arr = [a[0], a[1], ..., a[n-1]]. George can swap any two elements of the array any number of times. An array is beautiful if the sum of |arr[i] - arr[i-1]|among 0< i < n is minimal. + +Given the array , determine and return the minimum number of swaps that should be performed in order to make the array beautiful. + +For example, arr = [7, 15, 12, 3]. One minimal array is [3, 7, 12, 15]. To get there, George performed the following swaps: + +Swap Result + [7, 15, 12, 3] +3 7 [3, 15, 12, 7] +7 15 [3, 7, 12, 15] It took 2 swaps to make the array beautiful. This is minimal among the choice of beautiful arrays possible. \ No newline at end of file diff --git a/Lily's Homework/solution.py b/Array/Lily's Homework/solution.py similarity index 96% rename from Lily's Homework/solution.py rename to Array/Lily's Homework/solution.py index 8b29419..7783d49 100644 --- a/Lily's Homework/solution.py +++ b/Array/Lily's Homework/solution.py @@ -1,26 +1,26 @@ -def lilysHomework(arr): - m = {} - for i in range(len(arr)): - m[arr[i]] = i - sorted_arr = sorted(arr) - res = 0 - for i in range(len(arr)): - if(arr[i] != sorted_arr[i]): - res += 1 - x = m[sorted_arr[i]] - m[ arr[i] ] = m[ sorted_arr[i]] - arr[i],arr[x] = sorted_arr[i],arr[i] - return res - -if __name__ == '__main__': - fptr = open(os.environ['OUTPUT_PATH'], 'w') - - n = int(input()) - - arr = list(map(int, input().rstrip().split())) - - result = min(lilysHomework(list(arr)), lilysHomework(list(arr[::-1]))) - - fptr.write(str(result) + '\n') - - fptr.close() +def lilysHomework(arr): + m = {} + for i in range(len(arr)): + m[arr[i]] = i + sorted_arr = sorted(arr) + res = 0 + for i in range(len(arr)): + if(arr[i] != sorted_arr[i]): + res += 1 + x = m[sorted_arr[i]] + m[ arr[i] ] = m[ sorted_arr[i]] + arr[i],arr[x] = sorted_arr[i],arr[i] + return res + +if __name__ == '__main__': + fptr = open(os.environ['OUTPUT_PATH'], 'w') + + n = int(input()) + + arr = list(map(int, input().rstrip().split())) + + result = min(lilysHomework(list(arr)), lilysHomework(list(arr[::-1]))) + + fptr.write(str(result) + '\n') + + fptr.close() diff --git a/Array/Mislove Has Lost an Array/Question.txt b/Array/Mislove Has Lost an Array/Question.txt new file mode 100644 index 0000000..23182ac --- /dev/null +++ b/Array/Mislove Has Lost an Array/Question.txt @@ -0,0 +1,17 @@ +Mislove had an array a1, a2, ⋯, an of n positive integers, but he has lost it. He only remembers the following facts about it: + +1)The number of different numbers in the array is not less than l and is not greater than r. +2)For each array's element ai either ai=1 or ai is even and there is a number ai/2 in the array. + +For example, if n=5, l=2, r=3 then an array could be [1,2,2,4,4] or [1,1,1,1,2]; but it couldn't be [1,2,2,4,8] because this array contains 4 different numbers; it couldn't be [1,2,2,3,3] because 3 is odd and isn't equal to 1; and it couldn't be [1,1,2,2,16] because there is a number 16 in the array but there isn't a number 16/2=8. + +According to these facts, he is asking you to count the minimal and the maximal possible sums of all elements in an array. + +Input-1 +4 2 2 +Output +5 7 +Input-2 +5 1 5 +Output +5 31 diff --git a/Array/Mislove Has Lost an Array/Solution.cpp b/Array/Mislove Has Lost an Array/Solution.cpp new file mode 100644 index 0000000..841440f --- /dev/null +++ b/Array/Mislove Has Lost an Array/Solution.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; +int main() +{ + long long int i,mini=1,mine=0,maxi=1,maxo=0,n,s,e; + cin>>n>>s>>e; + + for(i=1;i<=s-1;i++) + { + mini=2*mini; + mine+=mini; + } +mine+=n-s+1; + +for(i=1;i<=e-1;i++) +{ + maxi=2*maxi; + maxo+=maxi; +} +maxo+=1; + + +maxo+=(n-e)*(maxi); +cout< +#include +#include + +int main() +{ + int t; + scanf("%d",&t); + while(t--){ + char str[100]; + scanf("%s",str); + int i; + int *arr = (int*)calloc(26,sizeof(int)); + for(i=0;imax){ + max = arr[i]; + c=i; + } + } + printf("%d %c\n",max,c+97); +} + return 0; +} diff --git a/Array/Philosophers_Stone/question.txt b/Array/Philosophers_Stone/question.txt new file mode 100644 index 0000000..f2474d3 --- /dev/null +++ b/Array/Philosophers_Stone/question.txt @@ -0,0 +1,30 @@ + + +One of the secret chambers in Hogwarts is full of philosopher’s stones. The floor of the chamber is covered by h × w square tiles, where there are h rows of tiles from front (first row) to back (last row) and w columns of tiles from left to right. Each tile has 1 to 100 stones on it. Harry has to grab as many philosopher’s stones as possible, subject to the following restrictions: + + He starts by choosing any tile in the first row, and collects the philosopher’s stones on that tile. Then, he moves to a tile in the next row, collects the philosopher’s stones on the tile, and so on until he reaches the last row. + When he moves from one tile to a tile in the next row, he can only move to the tile just below it or diagonally to the left or right. + +Given the values of h and w, and the number of philosopher’s stones on each tile, write a program to compute the maximum possible number of philosopher’s stones Harry can grab in one single trip from the first row to the last row. +Input + +The first line consists of a single integer T, the number of test cases. In each of the test cases, the first line has two integers. The first integer h (1 <= h <= 100) is the number of rows of tiles on the floor. The second integer w (1 <= w <= 100) is the number of columns of tiles on the floor. Next, there are h lines of inputs. The i-th line of these, specifies the number of philosopher’s stones in each tile of the i-th row from the front. Each line has w integers, where each integer m (0 <= m <= 100) is the number of philosopher’s stones on that tile. The integers are separated by a space character. +Output + +The output should consist of T lines, (1 <= T <= 100), one for each test case. Each line consists of a single integer, which is the maximum possible number of philosopher’s stones Harry can grab, in one single trip from the first row to the last row for the corresponding test case. +Example + +Input: +1 +6 5 +3 1 7 4 2 +2 1 3 1 1 +1 2 2 1 8 +2 2 1 5 3 +2 1 4 4 4 +5 2 7 5 1 + +Output: +32 + +//7+1+8+5+4+7=32 diff --git a/Array/Philosophers_Stone/solution.cpp b/Array/Philosophers_Stone/solution.cpp new file mode 100644 index 0000000..f3cc8e7 --- /dev/null +++ b/Array/Philosophers_Stone/solution.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; +int main(void) +{ + int t; + cin>>t; + while(t--) + { + int r,c; + cin>>r>>c; + int arr[r][c+2]={0}; + arr[0][c+1]=0; + + for(int i=0;i>arr[i][j]; + + for(int i=r-2;i>=0;i--) + for(int j=1;j<=c;j++) + arr[i][j]+=max((arr[i+1][j-1]),max(arr[i+1][j],arr[i+1][j+1])); + + int max = INT_MIN; + for(int i=1;i<=c;i++) + if(arr[0][i]>max) + max = arr[0][i]; + + cout< +using namespace std; + +int main(){ + int t; + cin>>t; + while(t--){ + int n; + cin>>n;int a[n]; + + for(int i=0;i>a[i]; + } + + int j=1;int good =1;int cnt=0;int t=0; + + for(int i=1;i=6)t++; + for(j=i-1;j>=t;j--){ + + if(a[j]>a[i]){ + cnt=1;} + + else { + cnt=0; + break;} + + } + + if(cnt==1) + good++; + + } + + cout< +using namespace std; + +long long maxValue = 10000000; + +vector sieve(long long n) { + vector prime; + prime.assign(n+1, true); + + prime[0] = prime[1] = false; + + for(int i=2; i prime = sieve(maxValue); + + scanf("%d", &cases); + + while(cases-- > 0) { + scanf("%d", &n); + + for(int i=2; i +using namespace std; +int main() +{ + int t,a,i,j,c,e,g,x,y; + cin>>t; + while(t>0) + { x=0; + y=0; + cin>>a; + int b[a]; + for( i=0;i>b[i]; + + cin>>c; + int d[c]; + for( i=0; i>d[i]; + + cin>>e; + int f[e]; + for(i=0;i>f[i]; + + cin>>g; + int h[g]; + for(i=0;i>h[i]; + + for(i=0;i +using namespace std; + +typedef long long int ll; + + +int main() +{ + ios::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); + + ll x11,x12,y11,y12; + ll x21,x22,y21,y22; + ll x31,x32,y31,y32; + + ll area = 0; + + cin>>x11>>y11>>x12>>y12; + cin>>x21>>y21>>x22>>y22; + cin>>x31>>y31>>x32>>y32; + + area = abs(x11-x12)*abs(y11-y12); + x21 = max(x11,x21); + y21 = max(y11,y21); + x22 = min(x12,x22); + y22 = min(y12,y22); + x31 = max(x11,x31); + y31 = max(y11,y31); + x32 = min(x12,x32); + y32 = min(y12,y32); + ll a1,a2,b1,b2; + if(x21 < x22 && y21 < y22) area -= abs(x21-x22)*abs(y21-y22); + if(x31 < x32 && y31 < y32) area -= abs(x31-x32)*abs(y31-y32); + if((x21x31) || (x21x32)) + { + if((y21 < y31 && y22 > y31) || (y21 < y32 && y22 > y32)) + { + ll narea = 0; + + } + } + + a1 = max(x21,x31); + b1 = max(y21,y31); + a2 = min(x22,x32); + b2 = min(y22,y32); + + if(a1 < a2 && b1 < b2) area += abs(a2-a1)*abs(b2-b1); + + if(area > 0) cout<<"YES\n"; + else cout<<"NO\n"; + + return 0; +} \ No newline at end of file diff --git a/Array/triplet_problem/question.txt b/Array/triplet_problem/question.txt new file mode 100644 index 0000000..b1417a8 --- /dev/null +++ b/Array/triplet_problem/question.txt @@ -0,0 +1 @@ +Find a triplet such that sum of two equals to third element in an array. diff --git a/Array/triplet_problem/solution.c b/Array/triplet_problem/solution.c new file mode 100644 index 0000000..69ac10c --- /dev/null +++ b/Array/triplet_problem/solution.c @@ -0,0 +1,48 @@ +#include + +void sort(int a[],int); +void findtriplet(int a[],int n) +{ + sort(a,n); + for(int k=n-1;k>=0;k--) + { + int i=0,j=k-1; + while(i (a[i]+a[j])) + i++; + else + j--; + } + } + printf("No such triplet exists\n"); +} + +void sort(int a[],int n) +{ + for(int i=0;i a[j+1]) + { + int t; + t = a[j]; + a[j] = a[j+1]; + a[j+1] = t; + } + } + } +} + +int main() +{ + int a[9] = {5,32,1,7,10,50,15,21,2}; + findtriplet(a,9); + return 0; +} diff --git a/Backtracking/Generate_parenthesis/Generate_Parenthesis.cpp b/Backtracking/Generate_parenthesis/Generate_Parenthesis.cpp new file mode 100644 index 0000000..0b6a580 --- /dev/null +++ b/Backtracking/Generate_parenthesis/Generate_Parenthesis.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +void Generate_Parenthesis(int open, int close, vector &ans, string s) +{ + if (close == 0) + { + ans.push_back(s); + return; + } + if (open) + { + string temp = s; + temp += '('; + Generate_Parenthesis(open - 1, close, ans, temp); + } + if (close > open) + { + string temp = s; + temp += ')'; + Generate_Parenthesis(open, close - 1, ans, temp); + } +} +int main() +{ + int n; + cin >> n; + vector ans; + Generate_Parenthesis(n, n, ans, ""); + for (int i = 0; i < ans.size(); i++) + cout << ans[i] << endl; +} \ No newline at end of file diff --git a/Backtracking/Generate_parenthesis/Question.txt b/Backtracking/Generate_parenthesis/Question.txt new file mode 100644 index 0000000..9012c1d --- /dev/null +++ b/Backtracking/Generate_parenthesis/Question.txt @@ -0,0 +1,7 @@ +Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. + +Sample Input +n = 3 + +Sample Output +["((()))","(()())","(())()","()(())","()()()"] \ No newline at end of file diff --git a/Backtracking/SudokuSolver/Question.txt b/Backtracking/SudokuSolver/Question.txt new file mode 100644 index 0000000..eadd651 --- /dev/null +++ b/Backtracking/SudokuSolver/Question.txt @@ -0,0 +1,20 @@ +Given a partially filled NxN 2D array, the goal is to assign digits (from 1 to 9) +to the empty cells (cells assigned O value) so that every row, column,and subgrid +of size 3×3 contains exactly one instance of the digits from 1 to 9. We provide the +value of N and a partially filled sudoku as input. + +Sample Input: +4 +3 4 1 0 0 2 0 0 0 0 2 0 0 1 4 3 + +Sample Output: +============== +3 4 1 0 +0 2 0 0 +0 0 2 0 +0 1 4 3 +============== +3 4 1 2 +1 2 3 4 +4 3 2 1 +2 1 4 3 diff --git a/Backtracking/SudokuSolver/sudokuSolver.cpp b/Backtracking/SudokuSolver/sudokuSolver.cpp new file mode 100644 index 0000000..5013019 --- /dev/null +++ b/Backtracking/SudokuSolver/sudokuSolver.cpp @@ -0,0 +1,100 @@ +#include +#include +using namespace std; + +void print2D(int arr[][20], int M, int N) { + for (int i = 0; i < M; ++i) { + for (int j = 0; j < N; ++j) { + cout << arr[i][j] << " "; + } + cout << endl; + } +} + +bool myfixed[20][20] = {}; + +void input2D_soduku(int arr[][20], int M, int N) +{ + for (int i = 0; i < M; ++i) + { + for (int j = 0; j < N; ++j) + { + cin >> arr[i][j]; + if (arr[i][j] != 0) myfixed[i][j] = true; //so that our entry does not change + } + } +} + +bool canPlace(int board[][20], int N, int x, int y, int num) +{ + //check along row && col + for (int i = 0; i < N; ++i) + { + if (board[x][i] == num) return false; //check along row + if (board[i][y] == num) return false; //check along col + } + + //check in the box + int rootN = sqrt(N); + int boxRow = x / rootN; + int boxCol = y / rootN; + int startRow = boxRow * rootN; + int startCol = boxCol * rootN; + + for (int r = startRow; r < startRow + rootN; ++r) + { + for (int c = startCol; c < startCol + rootN; ++c) + { + if (board[r][c] == num) return false; + } + } + + return true; +} + + +bool solveSudoku(int board[][20], int N, int x, int y) +{ + if (x == N && y == 0) return true; //we have reached row 4 ---->sudoku over + + if (y == N) return solveSudoku(board, N, x + 1, 0);//stop y to go to column4-->goto nxt row + + if (myfixed[x][y]) return solveSudoku(board, N, x , y + 1); + + for (int num = 1; num <= N; ++num) + { + if (canPlace(board, N, x, y, num) == true) + { + board[x][y] = num; + bool isSuccessful = solveSudoku(board, N, x , y + 1); //recursion for nxt columns + if (isSuccessful) return true; + else board[x][y] = 0; + } + } + return false; +} + +int main() +{ + int board[20][20] = {}; + + int N; + cin >> N; + input2D_soduku(board, N, N); + for(int i=0;i>board[i][j]; + } + } + cout << "==============\n"; + + print2D(board, N, N); + + cout << "==============\n"; + + solveSudoku(board, N, 0, 0); + + print2D(board, N, N); + +} + diff --git a/Armstrong No/armstrongnum.c b/Basic Math/Armstrong No/armstrongnum.c similarity index 100% rename from Armstrong No/armstrongnum.c rename to Basic Math/Armstrong No/armstrongnum.c diff --git a/Basic Math/Average/Average-Question.txt b/Basic Math/Average/Average-Question.txt new file mode 100644 index 0000000..2087165 --- /dev/null +++ b/Basic Math/Average/Average-Question.txt @@ -0,0 +1,81 @@ +Problem Name: Average + +You are given a sequence of integers a1, a2, ..., aN. An element ak is said to be an average element if there are indices i, j (with i ≠ j) such that ak = (ai + aj) / 2. + +In the sequence + +3 7 10 22 17 15 + +for i=1, j=5 and k=3, we get ak = (ai + aj)/2. Thus a3 = 10 is an average element in this sequence. You can check that a3 is the only average element in this sequence. + +Consider the sequence + +3 7 10 3 18 + +With i=1, j=4 and k=1 we get ak = (ai +aj)/2. Thus a1=3 is an average element. We could also choose i=1, j=4 and k=4 and get ak=(ai +aj)/2. You can check that a1 and a4 are the only average elements of this sequence. + +On the other hand, the sequence + +3 8 11 17 30 + +has no average elements. + +Your task is to count the number of average elements in the given sequence. + +Input format + +The first line contains a single integer N indicating the number of elements in the sequence. This is followed by N lines containing one integer each (Line i+1 contains ai). (You may assume that ai + aj would not exceed MAXINT for any i and j). + +Output format + +The output must consist of a single line containing a single integer k indicating the number of average elements in the given sequence. + +Test Data: + +You may assume that N ≤ 10000. Further, you may assume that in 30% of the inputs N ≤ 200 and that in 60% of the inputs N ≤ 5000. + +Example: + +We illustrate the input and output format using the above examples: + +Sample Input 1: + +6 +3 +7 +10 +17 +22 +15 + +Sample Output 1: + +1 + +Sample Input 2: + +5 +3 +7 +10 +3 +18 + +Sample Output 2: + +2 + +Sample Input 3; + +5 +3 +8 +11 +17 +30 + +Sample Output 3: + +0 +PROBLEM 2 avgBasics +Create a program to calculate the average of some integers taken input from user. diff --git a/Basic Math/Average/Solution.cpp b/Basic Math/Average/Solution.cpp new file mode 100644 index 0000000..eb8767c --- /dev/null +++ b/Basic Math/Average/Solution.cpp @@ -0,0 +1,56 @@ +#include +#include +int arr[100000]; +using namespace std; +int main() +{ + int n; + cin>>n; + for(int h=0;h>arr[h]; + sort(arr,arr+n); + int count=0; + for(int i=0;i=0 && h + +using namespace std; +int main() +{int x; +float total=0; +int num=0; + + +while (num<5){ + cin>>x; + total=total+x; + num=num+1; +} +float avgBasic= total/num; +cout< 3 + countChange(10, [5,2,3]) // => 4 + countChange(11, [5,7]) // => 0 \ No newline at end of file diff --git a/Basic Math/Counting-Change-Combinations/solution.js b/Basic Math/Counting-Change-Combinations/solution.js new file mode 100644 index 0000000..fcb7e85 --- /dev/null +++ b/Basic Math/Counting-Change-Combinations/solution.js @@ -0,0 +1,24 @@ +let countChange = function(money, coins) { + if (coins.length === 0) { + return 0; + } + + coins = coins.slice(0).sort(); + let result = 0, + largestCoin = coins.pop(), + maxCount = 0; + let maxRemain = money % largestCoin; + + if (maxRemain === 0) { + result++; + maxCount = money / largestCoin - 1; + } else { + maxCount = (money - maxRemain) / largestCoin; + } + + for (let i = maxCount; i >= 0; i--) { + result += countChange(money - largestCoin * i, coins); + } + + return result; +} \ No newline at end of file diff --git a/Basic Math/Divisibility_Check/Question.txt b/Basic Math/Divisibility_Check/Question.txt new file mode 100644 index 0000000..e063616 --- /dev/null +++ b/Basic Math/Divisibility_Check/Question.txt @@ -0,0 +1,7 @@ +You are given an array of integers. Check whether there exists a number in this array which is divisible by all other numbers in this array. Output 1, if such a number exists, and 0 otherwise. + +Input +The only line of the input contains a list of space-separated integers ai (1 ≤ ai ≤ 100) — elements of the array. The size of the array is between 2 and 10, inclusive. Note that the size of the array is not given explicitly! + +Output +Output 1 if there exists element of this array which is divisible by all other elements of the array, and 0 otherwise. \ No newline at end of file diff --git a/Basic Math/Divisibility_Check/Solution.cpp b/Basic Math/Divisibility_Check/Solution.cpp new file mode 100644 index 0000000..4f6298d --- /dev/null +++ b/Basic Math/Divisibility_Check/Solution.cpp @@ -0,0 +1,48 @@ +#include +using namespace std; +int main() +{ + char amp[100]; + cin.getline(amp,99,'\n'); + int len=strlen(amp); + + + int arr[10]={0}; + + int count=0,i=0; + int start=0; + for(int l=start;l<=len;l++) + { + + if(amp[l]==' ' || amp[l]=='\0') + { + //cout<<"hi "<=start;m--,n++) + { + arr[i]+= (amp[m]-'0')*pow(10,n); + + } + + if(l==len) + break; + i++; + start=l+1; + } + + } + + sort(arr,arr+count); + int ans=1; + for(int a=count-2;a>=0;a--) + { + if(arr[count-1]%arr[a]!=0) + { + ans=0; + break; + } + } + + cout< +void main() +{ + int i; + for(i=1;i<=100;i++) + { + if(i%3!=0 && i%5!=0) printf("%d\n", i); + if(i%3 == 0 && i%5!=0)printf("Fizz\n"); + if(i%5 == 0 && i%3!=0)printf("Buzz\n"); + if(i%5 == 0 && i%3==0)printf("FizzBuzz\n"); + } +} diff --git a/Basic Math/Fizz Buzz/fizzbuzz.cpp b/Basic Math/Fizz Buzz/fizzbuzz.cpp new file mode 100644 index 0000000..4d6c904 --- /dev/null +++ b/Basic Math/Fizz Buzz/fizzbuzz.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; +int main() +{ + for(int i=1;i<=100;i++){ + if((i%3 == 0) && (i%5==0)) + cout<<"FizzBuzz\n"; + else if(i%3 == 0) + cout<<"Fizz\n"; + else if(i%5 == 0) + cout<<"Buzz\n"; + else + cout< diff --git a/Basic Math/Fizz Buzz/python_solution.py b/Basic Math/Fizz Buzz/python_solution.py new file mode 100644 index 0000000..a770bbf --- /dev/null +++ b/Basic Math/Fizz Buzz/python_solution.py @@ -0,0 +1,9 @@ +for x in range(1, 100): + if (x % 15 == 0): + print "fizzbuzz" + elif x % 3 == 0: + print "fizz" + elif x % 5 == 0: + print "buzz" + else: + print x diff --git a/Basic Math/Fizz Buzz/ruby_solution.rb b/Basic Math/Fizz Buzz/ruby_solution.rb new file mode 100644 index 0000000..1d4bfee --- /dev/null +++ b/Basic Math/Fizz Buzz/ruby_solution.rb @@ -0,0 +1,14 @@ +counter = 0 + +while counter < 100 +counter += 1 + if (counter % 3 == 0) && (counter % 5 == 0) + puts("Fizz Buzz") + elsif counter % 3 == 0 + puts("Fizz") + elsif (counter % 5 == 0) + puts("Buzz") + else puts(counter) + end +end +break diff --git a/Basic Math/Is prime/problem.txt b/Basic Math/Is prime/problem.txt new file mode 100644 index 0000000..7357bc2 --- /dev/null +++ b/Basic Math/Is prime/problem.txt @@ -0,0 +1,9 @@ +Implement a function that determines if a given positive integer is a prime or not. + +Example + +For n = 47, the output should be +isPrime(n) = true; + +For n = 4, the output should be +isPrime(n) = false; \ No newline at end of file diff --git a/Basic Math/Is prime/solution.hs b/Basic Math/Is prime/solution.hs new file mode 100644 index 0000000..05b33bc --- /dev/null +++ b/Basic Math/Is prime/solution.hs @@ -0,0 +1 @@ +isPrime n = length (filter (==0) (map (mod n) [1..n])) == 2 \ No newline at end of file diff --git a/Basic Math/Is prime/solution.js b/Basic Math/Is prime/solution.js new file mode 100644 index 0000000..292a44a --- /dev/null +++ b/Basic Math/Is prime/solution.js @@ -0,0 +1,12 @@ +function isPrime(n) { + if(n<2) return false + let prime = true + for (let i = 2; i*i<= n; i++) { + if( n%i == 0) { + prime = false + break + } + } + + return prime +} diff --git a/Basic Math/Least_Common_Multiple/LCM.cbl b/Basic Math/Least_Common_Multiple/LCM.cbl new file mode 100644 index 0000000..ab35774 --- /dev/null +++ b/Basic Math/Least_Common_Multiple/LCM.cbl @@ -0,0 +1,78 @@ + IDENTIFICATION DIVISION. + + PROGRAM-ID.LCM. + + ENVIRONMENT DIVISION. + + DATA DIVISION. + + WORKING-STORAGE SECTION. + + 01 ARRAY. + 02 A PIC 9(5) OCCURS 10 TIMES. + 77 N PIC 9(2) VALUE 2. + 77 I PIC 9(2). + 77 J PIC 9(2). + 77 Q PIC 9(3). + 77 R PIC 9(3). + 77 K PIC 9(5). + 77 B PIC 9(3) VALUE 0. + 77 C PIC 9(3) VALUE 0. + 77 D PIC 9(3) VALUE 0. + 77 P PIC Z(5)9. + 01 num PIC 999 VALUE 0. + 01 num2 PIC 999 VALUE 0. + 01 chickens PIC 999 VALUE 0. + 01 dogs PIC 999 VALUE 0. + 01 total PIC 999 VALUE 0. + 01 result PIC 99 VALUE 0. + 01 result1 PIC 999 VALUE 0. + 01 result2 PIC 999 VALUE 0. + 01 count1 PIC 999 VALUE 0. + + PROCEDURE DIVISION. + + MAIN-PARA. + DISPLAY "ENTER " N " NUMBERS". + PERFORM X-PARA VARYING I FROM 1 BY 1 UNTIL I > N. + PERFORM Y-PARA VARYING I FROM B BY 1 UNTIL C = N. + MOVE K TO P. + DISPLAY "THE LCM IS " P. + + DISPLAY "Enter Number of Head". + ACCEPT num. + DISPLAY "Enter number of legs". + ACCEPT num2. + PERFORM headleg-PARA. + if count1 equals 2 DISPLAY "NONE" + STOP RUN. + + X-PARA. + ACCEPT A(I). + IF (B < A(I)) + MOVE A(I) TO B. + + Y-PARA. + MOVE 0 TO C. + COMPUTE D = D + 1. + PERFORM Z-PARA VARYING J FROM 1 BY 1 UNTIL J > N. + + Z-PARA. + COMPUTE K = B * D. + DIVIDE K BY A(J) GIVING Q REMAINDER R. + IF (R = 0) + COMPUTE C = C + 1. + + headleg-PARA. + PERFORM VARYING chickens FROM 0 BY 1 UNTIL chickens >= num + COMPUTE dogs = num - chickens + COMPUTE result =2 * chickens + COMPUTE result1 =4 * dogs + COMPUTE result2 = result + result1 + IF result2 EQUALS num2 + DISPLAY "[", chickens,",",dogs,"]" + SET count1 to 1 + ELSE IF count1 equals to 1 set count1 to 1 + else set count1 to 2 + END-IF + END-PERFORM. diff --git a/Basic Math/Least_Common_Multiple/Problem.txt b/Basic Math/Least_Common_Multiple/Problem.txt new file mode 100644 index 0000000..83e009c --- /dev/null +++ b/Basic Math/Least_Common_Multiple/Problem.txt @@ -0,0 +1,6 @@ +## Problem: + +The LCM of two integers n1 and n2 is the smallest positive integer that is perfectly +divisible by both n1 and n2 (without a remainder). For example: the LCM of 72 and 120 is 360. + +write a program written in COBOL that will compute the LCM of 2 numbers diff --git a/Basic Math/Number to Words/number_to_words.CPP b/Basic Math/Number to Words/number_to_words.CPP new file mode 100644 index 0000000..94e3047 --- /dev/null +++ b/Basic Math/Number to Words/number_to_words.CPP @@ -0,0 +1,62 @@ +//Converts any number between 0-9999 (inclusive) to words +//till 4 digits only + +#include +#include + +void words(int n, int c, int r) +{ + if(n==0 && c==1) + { + cout<<"Zero"<=20 || n==10) + { + cout<<" "<=14) + cout<<" "<>n; + int n1=n; + int count=0, rev=0; + while(n1!=0) + { + rev=rev*10+(n1%10); + count++; + n1=n1/10; + } + words(n,count,rev); + getch(); +} \ No newline at end of file diff --git a/Basic Math/Number to Words/problem_definition.txt b/Basic Math/Number to Words/problem_definition.txt new file mode 100644 index 0000000..0e39580 --- /dev/null +++ b/Basic Math/Number to Words/problem_definition.txt @@ -0,0 +1,4 @@ +Write code to convert a given number into words. +For example, +if “1234†is given as input +output should be “one thousand two hundred thirty fourâ€. \ No newline at end of file diff --git a/Basic Math/Octal Decimal Calculator/Octal Decimal Calculator.txt b/Basic Math/Octal Decimal Calculator/Octal Decimal Calculator.txt new file mode 100644 index 0000000..0ff00e0 --- /dev/null +++ b/Basic Math/Octal Decimal Calculator/Octal Decimal Calculator.txt @@ -0,0 +1,9 @@ +Given an octal number it is required to convert to decimal and print it on the console + +Example: + +The octal number 567 is entered. + +The system calculates the equivalent number in decimal that is 375 and prints it on the console + +The decimal number for octal 567 is: 357 \ No newline at end of file diff --git a/Basic Math/Octal Decimal Calculator/OctalDecimalCalculator.java b/Basic Math/Octal Decimal Calculator/OctalDecimalCalculator.java new file mode 100644 index 0000000..dac72a3 --- /dev/null +++ b/Basic Math/Octal Decimal Calculator/OctalDecimalCalculator.java @@ -0,0 +1,43 @@ +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +public class OctalDecimalCalculator { + + private static int BASE_8 = 8; + private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + private static final String RESULT_TEMPLATE = "The decimal number for octal %s is: %s"; + + public static void main(String[] args){ + + System.out.println("Please input octal number to convert"); + try { + String octal = br.readLine(); + String decimal = convertOctalToDecimal(Integer.parseInt(octal)); + + System.out.println(String.format(RESULT_TEMPLATE, octal, decimal)); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + public static String convertOctalToDecimal(int octal){ + int result = 0; + String tmp = String.valueOf(octal); + int count = 0; + int multiple; + String caracter; + for (int i = tmp.length(); i > 0; i--) { + caracter = tmp.substring(i-1, i); + multiple = (int) Math.pow(BASE_8, count); + int value = (Integer.parseInt(caracter) * multiple); + count = count + 1; + result += value; + + } + + return String.valueOf(result); + } + +} diff --git a/Basic Math/Odd or Even Game/.idea/Odd or Even Game.iml b/Basic Math/Odd or Even Game/.idea/Odd or Even Game.iml new file mode 100644 index 0000000..68d86b9 --- /dev/null +++ b/Basic Math/Odd or Even Game/.idea/Odd or Even Game.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Basic Math/Odd or Even Game/.idea/misc.xml b/Basic Math/Odd or Even Game/.idea/misc.xml new file mode 100644 index 0000000..191aa28 --- /dev/null +++ b/Basic Math/Odd or Even Game/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Basic Math/Odd or Even Game/.idea/modules.xml b/Basic Math/Odd or Even Game/.idea/modules.xml new file mode 100644 index 0000000..88a00c5 --- /dev/null +++ b/Basic Math/Odd or Even Game/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Basic Math/Odd or Even Game/.idea/vcs.xml b/Basic Math/Odd or Even Game/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Basic Math/Odd or Even Game/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Basic Math/Odd or Even Game/.idea/workspace.xml b/Basic Math/Odd or Even Game/.idea/workspace.xml new file mode 100644 index 0000000..1a68506 --- /dev/null +++ b/Basic Math/Odd or Even Game/.idea/workspace.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +