├── 123vivekr ├── averybigsum.cpp ├── birthdaycakecandles.py ├── camelcase.py ├── comparethetriplets.cpp ├── designerPDF.py ├── diagonaldifference.cpp ├── hurdlerace.py ├── readme.md ├── simplearraysum.cpp ├── solvemefirst.py └── timeconversion.py ├── AK04 ├── Warmup Exercises │ ├── 1-solve-me-first.lol │ ├── 10-time-conversion.cpp │ ├── 2-simple-array-sum.cpp │ ├── 3-compare-the-triplets.cpp │ ├── 4-a-very-big-sum.cpp │ ├── 5-diagonal-difference.cpp │ ├── 6-plus-minus.cpp │ ├── 7-staircase.cpp │ ├── 8-mini-max-sum.cpp │ └── 9-birthday-cake-candles.cpp └── readme.md ├── AjeshKumarS ├── a-very-big-sum ├── angry-professor.py ├── append-and-delete.py ├── apple-and-orange.py ├── beautiful-days-at-the-movies.py ├── between-two-sets.py ├── big-sorting.py ├── birthday-cake-candles.py ├── birthday-chocolate.py ├── bon-appetit.py ├── breaking-the-records.py ├── camelcase.py ├── cats-and-a-mouse.py ├── circular-array-rotation.py ├── climbing-the-leaderboard.py ├── compare-the-triplets ├── counting-valleys.py ├── cut-the-sticks.py ├── day-of-the-programmer.py ├── designer-pdf-viewer.py ├── diagonal-difference ├── divisible-sum-pairs.py ├── dwaring-book.py ├── electronics-shop.py ├── equalize-the-array.py ├── extra-long-factorials.py ├── find-digits.py ├── grading-students.py ├── jumping-on-the-clouds.py ├── jumping-on-the-clouds2.py ├── kangaroo.py ├── mars-exploration.py ├── migratory-birds.py ├── mini-max-sum.py ├── picking-numbers.py ├── plus-minus.py ├── readme.md ├── repeated-string.py ├── save-the-prisoner.py ├── sequence-equation.py ├── sherlock-and-squares.py ├── simple-array-sum.py ├── sock-merchant.py ├── solve-me-first.py ├── staircase.py ├── super-reduced-string.py ├── taum-and-bday.py ├── the-hurdle-race.py ├── time-conversion.py ├── utopian-tree.py └── viral-advertising.py ├── AlbertBGeorge ├── a-very-big-sum.py ├── apple-and-orange.py ├── between-two-sets.py ├── birthday-cake-candles.py ├── bon-appetit.py ├── breaking-best-and-worst-records.py ├── compare-the-triplets.py ├── day-of-the-programmer.py ├── diagonal-difference.py ├── divisible-sum-pairs.py ├── grading.py ├── hr-submissions.txt ├── kangaroo.py ├── migratory-birds.py ├── mini-max-sum.py ├── plus-minus.py ├── readme.md ├── simple-array-sum.py ├── solve-me-first.py ├── staircase.py ├── the-birthday-bar.py └── time-conversion.py ├── AshmiFathima ├── AVeryBigSum.py ├── AppleAndOrange.cpp ├── Beautifuldaysatthemovies.py ├── BirthdayCakeCandles.py ├── BonAppetit.py ├── BreakingTheRecords.cpp ├── CamelCase.cpp ├── CatsandaMouse.cpp ├── CompareTheTriplets.cpp ├── Correctnessandloopinvariant.cpp ├── Dayoftheprogrammer.cpp ├── DiagonalDifference.cpp ├── DivisibleSumPairs.cpp ├── Encryption.cpp ├── ExtraLongFactorials.py ├── GradingStudents.py ├── Kangaroo.cpp ├── MarsExploration.py ├── MigratoryBirds.py ├── MiniMaxSum.py ├── PlusMinus.cpp ├── SimpleArraySum.py ├── SolveMeFirst.cpp ├── Staircase.py ├── TheHurdleRace.cpp ├── TimeConversion.py └── readme.md ├── JoyalAJohney ├── implementation │ ├── apple-and-orange.py │ ├── between-two-sets.py │ ├── bon-appetit.py │ ├── breaking-best-and-worst-record.py │ ├── day-of-the-programmer.py │ ├── drawing-book.py │ ├── grading.py │ ├── kangaroo.py │ ├── migratory-birds.py │ ├── sock-merchant.py │ └── the-birthday-bar.py ├── readme.md └── warmup │ ├── a-very-big-sum.py │ ├── birthday-cake-candles.py │ ├── compare-the-triplets.py │ ├── diagonal-difference.py │ ├── mini-max-sum.py │ ├── plus-minus.py │ ├── simple-array-sum.py │ ├── solve-me-first.py │ └── time-conversion.py ├── KowalskiA ├── 1.solveMeFirst.py ├── 10.timeConversion.py ├── 11.gradingStudents.py ├── 12.appleAndOrange ├── 13.kangaroo ├── 14.betweenTwoSets.py ├── 15.breakingTheRecords.py ├── 16.birthdayChocolate.py ├── 17.divisibleSumPair.py ├── 18.migratoryBirds.py ├── 19.dayOfTheProgrammer.py ├── 2.simpleArraySum.py ├── 20.bonAppetit.py ├── 21.Sockmerchant.py ├── 22.drawinBook.py ├── 3.compareTheTriplets.py ├── 4.aVeryBigSum.py ├── 5.diagonalDifference.py ├── 6.plusMinus.py ├── 7.staircase.py ├── 8.mini-maxSum.py ├── 9.birthdayCakeCandles.py └── readme.md ├── NevilleAntony98 ├── Implementation │ ├── apple-and-orange.cpp │ ├── between-two-sets.cpp │ ├── breaking-best-and-worst-records.cpp │ ├── divisible-sum-pairs.cpp │ ├── grading-students.cpp │ ├── kangaroo.cpp │ └── the-birthday-bar.cpp ├── README.md └── Warmup │ ├── a-very-big-sum.cpp │ ├── birthday-cake-candles.cpp │ ├── compare-the-triplets.cpp │ ├── diagonal-difference.cpp │ ├── mini-max-sum.cpp │ ├── plus-minus.cpp │ ├── simple-array-sum.cpp │ ├── solve-me-first.cpp │ ├── staricase.cpp │ └── time-conversion.cpp ├── README.md ├── RahulR19 └── readme.md ├── SadayNarayanan ├── helloworld.md └── readme.md ├── Sneha0104 └── README.md ├── SrividyaKK ├── Hackerrank Submissions │ ├── A Very Big Sum.py │ ├── Birthday Cake Candles.py │ ├── Compare the Triplets.py │ ├── Diagonal Difference.py │ ├── Mini-Max Sum.py │ ├── Simple Array Sum.py │ ├── Solve me First.py │ ├── Staircase.py │ └── kangaroo.py └── README.md ├── Wayne297 └── readme.md ├── agzuniverse ├── a-very-big-sum.py ├── apple-and-orange.py ├── between-sets.py ├── birthday-bar.py ├── birthday-cake-candles.py ├── bon-appetit.py ├── breaking-best-and-worst-records.py ├── camelCase.py ├── compare-the-triplets.py ├── day-of-the-programmer.py ├── diagonal-difference.py ├── grading.py ├── kangaroo.py ├── migratory-birds.py ├── mini-max-sum.py ├── plus-minus.py ├── readme.md ├── simple-array-sum.py ├── solve-me-first.py ├── staircase.py ├── super-reduced-string.py └── time-conversion.py ├── alfvj17 ├── 1.solveMeFirst.cpp ├── 10.timeConversion.cpp ├── 11.gradingStudents.cpp ├── 12.appleAndOrange.cpp ├── 13.kangaroo.cpp ├── 14.betweenTwoSets.cpp ├── 15.breakingTheRecords.cpp ├── 16.birthdayChocolate.cpp ├── 17.divisibleSumPair.cpp ├── 18.migratoryBirds.cpp ├── 19.dayOfProgrammer.cpp ├── 2.camelCase.cpp ├── 2.simpleArraySum.cpp ├── 20.bonAppetit.cpp ├── 21.sockMerchant.cpp ├── 22.drawingBook.cpp ├── 25.catsAndMouse.cpp ├── 29.theHurdleRace.cpp ├── 3.compareTheTriplets.cpp ├── 39.findDigits.cpp ├── 4.aVeryBigSum.cpp ├── 40.extraLongFactorial.py ├── 5.diagonalDifference.cpp ├── 6.plusMinus.cpp ├── 7.staircase.cpp ├── 8.mini-maxSum.cpp ├── 9.birthdayCakeCandles.cpp └── readMe.md ├── arjunlal99 └── README.md ├── aswin1999 └── README.md ├── carrotss ├── README.md ├── simple-array-sum.py └── solve-me-first.py ├── firebreath1001 └── readme.md ├── hari-xix └── README.md ├── hello-world.md ├── j-winfield └── readme.md ├── kss682 ├── a vey big sum.py ├── compare the triplets.py ├── diagoanaldiff.py ├── kangroo.py ├── plusminus.py ├── readme.md ├── simple_array_sum.py └── staircase.py ├── mennyt11 └── readme.md ├── my first commit ├── pkn2000 └── README.md ├── shwethabm └── readme.md ├── steevjames └── readme.md └── vidyasreekumar └── readme.md /123vivekr/averybigsum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | long aVeryBigSum(int n, vector ar) { 6 | long long sum = 0; 7 | for(int i = 0; i < n; ++i) 8 | { 9 | sum += ar[i]; 10 | } 11 | return sum; 12 | } 13 | 14 | int main() { 15 | int n; 16 | cin >> n; 17 | vector ar(n); 18 | for(int ar_i = 0; ar_i < n; ar_i++){ 19 | cin >> ar[ar_i]; 20 | } 21 | long result = aVeryBigSum(n, ar); 22 | cout << result << endl; 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /123vivekr/birthdaycakecandles.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def birthdayCakeCandles(n, ar): 6 | return ar.count(max(ar)) 7 | 8 | n = int(input().strip()) 9 | ar = list(map(int, input().strip().split(' '))) 10 | result = birthdayCakeCandles(n, ar) 11 | print(result) 12 | -------------------------------------------------------------------------------- /123vivekr/camelcase.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | s = input().strip() 5 | print(1 + sum(1 for c in s if c.isupper())) 6 | -------------------------------------------------------------------------------- /123vivekr/comparethetriplets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | vector < int > solve(int a0, int a1, int a2, int b0, int b1, int b2){ 6 | int pa = 0, pb = 0; 7 | int a[] = {a0, a1, a2}, b[] = {b0, b1, b2}; 8 | for(int i = 0; i < 3; ++i) 9 | { 10 | if(a[i] > b[i]) 11 | pa++; 12 | else if(b[i] > a[i]) 13 | pb++; 14 | } 15 | return {pa, pb}; 16 | } 17 | 18 | int main() { 19 | int a0; 20 | int a1; 21 | int a2; 22 | cin >> a0 >> a1 >> a2; 23 | int b0; 24 | int b1; 25 | int b2; 26 | cin >> b0 >> b1 >> b2; 27 | vector < int > result = solve(a0, a1, a2, b0, b1, b2); 28 | for (ssize_t i = 0; i < result.size(); i++) { 29 | cout << result[i] << (i != result.size() - 1 ? " " : ""); 30 | } 31 | cout << endl; 32 | 33 | 34 | return 0; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /123vivekr/designerPDF.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | h = list(map(int, input().strip().split(' '))) 7 | word = input().strip() 8 | l = len(word) 9 | a = ord('a') 10 | tallest = h[ord(word[0]) - a] 11 | for x in word[1:]: 12 | t = h[ord(x) - a] 13 | if(t > tallest): 14 | tallest = t 15 | print(len(word) * tallest) 16 | -------------------------------------------------------------------------------- /123vivekr/diagonaldifference.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | 10 | int main() { 11 | int n; 12 | cin >> n; 13 | int a[n][n]; 14 | for(int i = 0;i < n; ++i) 15 | { 16 | for(int j = 0; j < n; ++j) 17 | cin>>a[i][j]; 18 | } 19 | int s1 = 0, s2 = 0; 20 | for(int i = 0;i < n; ++i) 21 | { 22 | for(int j = 0; j < n; ++j) 23 | { 24 | if(i == j) 25 | s1+=a[i][j]; 26 | if(i+j == n - 1) 27 | s2+=a[i][j]; 28 | } 29 | } 30 | cout< k): 10 | print(max(height) - k) 11 | else: 12 | print(0) 13 | -------------------------------------------------------------------------------- /123vivekr/readme.md: -------------------------------------------------------------------------------- 1 | Hi there, my name is Vivek. I'm from CS1A. I'm interested in programming and 2 | I would like to contribute to the Open Source Community. I consider myself 3 | as a beginner and I hope to learn more as I go forward with FossMec. 4 | -------------------------------------------------------------------------------- /123vivekr/simplearraysum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int simpleArraySum(int n, vector ar) { 6 | int sum = 0; 7 | for(int i = 0; i < n; ++i) 8 | { 9 | sum+=ar[i]; 10 | } 11 | return sum; 12 | } 13 | 14 | int main() { 15 | int n; 16 | cin >> n; 17 | vector ar(n); 18 | for(int ar_i = 0; ar_i < n; ar_i++){ 19 | cin >> ar[ar_i]; 20 | } 21 | int result = simpleArraySum(n, ar); 22 | cout << result << endl; 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /123vivekr/solvemefirst.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | return a+b 3 | 4 | 5 | num1 = int(input()) 6 | num2 = int(input()) 7 | res = solveMeFirst(num1,num2) 8 | print(res) 9 | -------------------------------------------------------------------------------- /123vivekr/timeconversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def timeConversion(s): 6 | n = s 7 | if(s[8:] == "AM"): 8 | if(int(s[:2]) == 12): 9 | n = "00" + s[2:8] 10 | else: 11 | if(int(s[:2]) != 12): 12 | n = str(int(s[:2]) + 12) + s[2:8] 13 | return n[:8] 14 | 15 | 16 | s = input().strip() 17 | result = timeConversion(s) 18 | print(result) 19 | 20 | -------------------------------------------------------------------------------- /AK04/Warmup Exercises/1-solve-me-first.lol: -------------------------------------------------------------------------------- 1 | HAI 1.2 2 | 3 | OBTW I NO DEECLAIR EVARY THINS AS NUMBR 4 | BUD ITZ GUD TO DUH IT 5 | DHA LINK TO SUBMANSION - https://www.hackerrank.com/challenges/solve-me-first/submissions/code/53485582 6 | TLDR 7 | 8 | I HAS A NUMBA 9 | I HAS A NUMBU 10 | 11 | GIMMEH NUMBA 12 | GIMMEH NUMBU 13 | 14 | VISIBLE SUM OF NUMBA AN NUMBU 15 | 16 | KTHXBYE 17 | -------------------------------------------------------------------------------- /AK04/Warmup Exercises/10-time-conversion.cpp: -------------------------------------------------------------------------------- 1 | //link to sub: https://www.hackerrank.com/challenges/time-conversion/submissions/code/54000169 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | char t[10]; 13 | int i, j, k, l; 14 | 15 | for(j=0; j<10;++j) 16 | cin>>t[j]; 17 | 18 | k = t[0] - '0'; 19 | l = t[1] - '0'; 20 | i = 10*k + l; 21 | 22 | if(t[8]=='P') { 23 | if(i!=12) 24 | i+=12; 25 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | 11 | int main() { 12 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 13 | 14 | int n, a, sum=0; 15 | cin>>n; 16 | 17 | for(int i=0; i < n; ++i) { 18 | cin>>a; 19 | sum+= a; 20 | } 21 | 22 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | 13 | int a[3], b[3], c=0, d=0; 14 | 15 | 16 | for(int i=0; i<3; ++i) { 17 | cin>>a[i]; 18 | } 19 | 20 | for(int i=0; i<3; ++i) { 21 | cin>>b[i]; 22 | } 23 | 24 | for(int i=0; i<3; ++i) { 25 | if(a[i] > b[i]) 26 | c++; 27 | else if(a[i] < b[i]) 28 | d++; 29 | } 30 | 31 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | 11 | int main() { 12 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 13 | int n; 14 | long sum=0, m; 15 | 16 | cin>>n; 17 | 18 | for(int i=0; i>m; 20 | sum+=m; 21 | } 22 | 23 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | int a[100][100], n, sum1=0, sum2=0, m; 13 | 14 | cin>>n; 15 | m=n-1; 16 | 17 | for(int i=0; i>a[i][j]; 20 | if(i==j) 21 | sum1+=a[i][j]; 22 | } 23 | sum2+=a[i][m]; 24 | --m; 25 | } 26 | 27 | int s = sum1 - sum2; 28 | 29 | if(s<0) { 30 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | using namespace std; 10 | 11 | int main() { 12 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 13 | float a=0, b=0, c=0, n, x, ap, bp, cp; 14 | 15 | cin>>n; 16 | 17 | for(int i=0; i>x; 19 | if(x>0) 20 | ++a; 21 | else if(x<0) 22 | ++b; 23 | else 24 | ++c; 25 | } 26 | 27 | ap=float(a/n); 28 | bp=float(b/n); 29 | cp=float(c/n); 30 | 31 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | int n; 13 | cin>>n; 14 | 15 | for(int i=1; i<=n; ++i) { 16 | 17 | for(int k=0; k0; --k) 20 | cout<<"#"; 21 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | 13 | long a[5], s=0; 14 | int i, sm=0, la=0; 15 | 16 | for(i=0; i<5; ++i) { 17 | cin>>a[i]; 18 | s+=a[i]; 19 | } 20 | 21 | for(i=0; i<5; ++i) { 22 | if(a[i]>=a[la]) 23 | la=i; 24 | if(a[i]<=a[sm]) 25 | sm=i; 26 | } 27 | 28 | cout< 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | int main() { 11 | /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 12 | 13 | long n, i, x, c=0, l=0; 14 | cin>>n; 15 | 16 | for(i=0; i>x; 18 | if(x==l) 19 | c++; 20 | if(x>l) { 21 | c=1; 22 | l=x; 23 | } 24 | } 25 | 26 | cout< 29 | [CodePen](https://codepen.io/LemonIceTea/ "Albin's CodePen Profile"). 30 | 31 | # Fun stuff! 32 | 33 | Recently **Nvidia** asked me to host servers and organise Counter Strike: Global Offensive tournaments for **HyperX**, **LG**, **Nvidia** and **Zotac** at **Nvidia Gamer Connect Kochi**! 34 | 35 | I brought my friends along and we made a **vlog**! Check it out by clicking on the image below! 36 | 37 | Vlog 38 | -------------------------------------------------------------------------------- /AjeshKumarS/a-very-big-sum: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | s = 0 7 | for x in range(n): 8 | s+=ar[x] 9 | return s 10 | 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = aVeryBigSum(n, ar) 14 | print(result) 15 | -------------------------------------------------------------------------------- /AjeshKumarS/angry-professor.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | t = int(input().strip()) 7 | for a0 in range(t): 8 | n,k = input().strip().split(' ') 9 | n,k = [int(n),int(k)] 10 | a = [int(a_temp) for a_temp in input().strip().split(' ')] 11 | c = 0 12 | for x in a: 13 | if(x<=0): 14 | c+=1 15 | if(c= s and (a+apple[i]) <= t): 18 | c1+=1 19 | 20 | for j in range(n): 21 | if((b+orange[j]) >= s and (b+orange[j]) <= t): 22 | c2+=1 23 | 24 | print("{}\n{}".format(c1,c2)) -------------------------------------------------------------------------------- /AjeshKumarS/beautiful-days-at-the-movies.py: -------------------------------------------------------------------------------- 1 | def rev(num): 2 | b = '' 3 | m = str(num) 4 | for l in range(len(m)): 5 | b+=m[len(m)-l-1] 6 | return int(b) 7 | 8 | 9 | i, j, k = [int(x) for x in input().split()] 10 | c = 0 11 | for x in range(i,j+1): 12 | if(abs(x-rev(x))%k is 0): 13 | c+=1 14 | print(c) -------------------------------------------------------------------------------- /AjeshKumarS/between-two-sets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getTotalX(a, b): 6 | c = 0 7 | x = sorted(a) 8 | y = sorted(b) 9 | for i in range(x[len(a)-1], y[0]+1): 10 | for j in a: 11 | if(i%j != 0): 12 | break 13 | else: 14 | for j in b: 15 | if(j%i != 0): 16 | break 17 | else: 18 | c+=1 19 | return c 20 | 21 | if __name__ == "__main__": 22 | n, m = input().strip().split(' ') 23 | n, m = [int(n), int(m)] 24 | a = list(map(int, input().strip().split(' '))) 25 | b = list(map(int, input().strip().split(' '))) 26 | total = getTotalX(a, b) 27 | print(total) -------------------------------------------------------------------------------- /AjeshKumarS/big-sorting.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | n = int(input().strip()) 6 | x = {} 7 | 8 | for i in range(n): 9 | num = input().strip() 10 | l = len(num) 11 | 12 | if not l in x: 13 | x[l] = [] 14 | 15 | x[l].append(num) 16 | 17 | for y in sorted(x): 18 | for v in sorted(x[y]): 19 | print(v) -------------------------------------------------------------------------------- /AjeshKumarS/birthday-cake-candles.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def birthdayCakeCandles(n, ar): 6 | n1=n2=0 7 | for i in range(n): 8 | if(ar[i]>n1): 9 | n1 = ar[i] 10 | for f in ar: 11 | if(f==n1): 12 | n2+=1 13 | return n2 14 | 15 | n = int(input().strip()) 16 | ar = list(map(int, input().strip().split(' '))) 17 | result = birthdayCakeCandles(n, ar) 18 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/birthday-chocolate.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(n, s, d, m): 6 | i = 0 7 | ct = 0 8 | while((i+m)<=n): 9 | sum = 0 10 | for x in range(m): 11 | sum+=s[i+x] 12 | 13 | if(sum is d): 14 | ct+=1 15 | i+=1 16 | return ct 17 | 18 | n = int(input().strip()) 19 | s = list(map(int, input().strip().split(' '))) 20 | d, m = input().strip().split(' ') 21 | d, m = [int(d), int(m)] 22 | result = solve(n, s, d, m) 23 | print(result) 24 | -------------------------------------------------------------------------------- /AjeshKumarS/bon-appetit.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def bonAppetit(n, k, b, ar): 6 | s = 0 7 | for i in range(n): 8 | if(i!=k): 9 | s+=ar[i] 10 | if(s/2 == b): 11 | return 'Bon Appetit' 12 | else: 13 | return int(abs(b-s/2)) 14 | 15 | n, k = input().strip().split(' ') 16 | n, k = [int(n), int(k)] 17 | ar = list(map(int, input().strip().split(' '))) 18 | b = int(input().strip()) 19 | result = bonAppetit(n, k, b, ar) 20 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/breaking-the-records.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getRecord(s): 6 | h=l=s[0] 7 | hc=lc=0 8 | for i in range(len(s)): 9 | if(s[i]>h): 10 | h = s[i] 11 | hc+=1 12 | elif(s[i] abs(z-y)): 13 | print("Cat B") 14 | else: 15 | print("Mouse C") -------------------------------------------------------------------------------- /AjeshKumarS/circular-array-rotation.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def rotate(a,k,n): 6 | for _ in range(k): 7 | x = a.pop() 8 | a.insert(0,x) 9 | return a 10 | 11 | 12 | n,k,q = input().strip().split(' ') 13 | n,k,q = [int(n),int(k),int(q)] 14 | a = [int(a_temp) for a_temp in input().strip().split(' ')] 15 | y = rotate(a,k,n) 16 | for a0 in range(q): 17 | m = int(input().strip()) 18 | print(y[m]) 19 | -------------------------------------------------------------------------------- /AjeshKumarS/climbing-the-leaderboard.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | scores = [int(scores_temp) for scores_temp in input().strip().split(' ')] 8 | m = int(input().strip()) 9 | alice = [int(alice_temp) for alice_temp in input().strip().split(' ')] 10 | 11 | x = sorted(set(scores), reverse = True) 12 | l = len(x) 13 | 14 | for a in alice: 15 | while(l>0 and a>=x[l-1]): 16 | l-=1 17 | print(l+1) -------------------------------------------------------------------------------- /AjeshKumarS/compare-the-triplets: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | ar = [a0, a1, a2] 7 | br = [b0, b1, b2] 8 | a = 0 9 | b = 0 10 | for x in range(3): 11 | if(ar[x] > br[x]): 12 | a+=1 13 | elif(ar[x] < br[x]): 14 | b+=1 15 | return str(a) + str(b) 16 | 17 | a0, a1, a2 = input().strip().split(' ') 18 | a0, a1, a2 = [int(a0), int(a1), int(a2)] 19 | b0, b1, b2 = input().strip().split(' ') 20 | b0, b1, b2 = [int(b0), int(b1), int(b2)] 21 | result = solve(a0, a1, a2, b0, b1, b2) 22 | print (" ".join(map(str, result))) 23 | -------------------------------------------------------------------------------- /AjeshKumarS/counting-valleys.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | n = int(input()) 4 | way = input() 5 | l = 0 6 | v = 0 7 | for i in range(n): 8 | if(way[i] == 'U'): 9 | l+=1 10 | else: 11 | l-=1 12 | if(l==0 and way[i]=='U'): 13 | v+=1 14 | print(v) -------------------------------------------------------------------------------- /AjeshKumarS/cut-the-sticks.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 8 | 9 | 10 | while n>-1: 11 | if len(arr)==0: 12 | break 13 | print(len(arr)) 14 | arr = [x for x in arr if x!= min(arr)] -------------------------------------------------------------------------------- /AjeshKumarS/day-of-the-programmer.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(year): 6 | if (year == 1918): 7 | return '26.09.1918' 8 | elif((year<=1917) & (year%4==0)) or ((year>1918) & (year%400==0 or ((year%4 == 0) & (year%100 != 0)))): 9 | return '12.09.{}'.format(year) 10 | else: 11 | return '13.09.{}'.format(year) 12 | 13 | 14 | year = int(input().strip()) 15 | result = solve(year) 16 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/designer-pdf-viewer.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | h = list(map(int, input().strip().split(' '))) 7 | word = input().strip() 8 | 9 | max = 0 10 | for x in word: 11 | if(h[ord(x)-97] > max): 12 | max = h[ord(x)-97] 13 | print(len(word)*max) -------------------------------------------------------------------------------- /AjeshKumarS/diagonal-difference: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def result(x,ar): 6 | d1=d2 = 0 7 | for i in range(x): 8 | d1+=ar[i][i] 9 | d2+=ar[i][x-i-1] 10 | return abs(d1-d2) 11 | 12 | 13 | n = int(input().strip()) 14 | a = [] 15 | for a_i in range(n): 16 | a_t = [int(a_temp) for a_temp in input().strip().split(' ')] 17 | a.append(a_t) 18 | print(result(n, a)) -------------------------------------------------------------------------------- /AjeshKumarS/divisible-sum-pairs.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def divisibleSumPairs(n, k, ar): 6 | ct = 0 7 | for j in range(n): 8 | i = 0 9 | while(ivf): 8 | vf = a.count(x) 9 | v = x 10 | print(len(a)-vf) -------------------------------------------------------------------------------- /AjeshKumarS/extra-long-factorials.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | p = 1 8 | for i in range(1,n+1): 9 | p*=i 10 | print(p) -------------------------------------------------------------------------------- /AjeshKumarS/find-digits.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | t = int(input().strip()) 7 | for a0 in range(t): 8 | n = input().strip() 9 | c = 0 10 | for i in range(len(n)): 11 | if(int(n[i])!=0 and int(n)%int(n[i]) is 0): 12 | c+=1 13 | print(c) -------------------------------------------------------------------------------- /AjeshKumarS/grading-students.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(grades): 6 | for i in range(len(grades)): 7 | if(grades[i]>37): 8 | for j in range(1,3): 9 | if((grades[i]+j) % 5 is 0): 10 | grades[i]+=j 11 | break 12 | return grades 13 | 14 | n = int(input().strip()) 15 | grades = [] 16 | grades_i = 0 17 | for grades_i in range(n): 18 | grades_t = int(input().strip()) 19 | grades.append(grades_t) 20 | result = solve(grades) 21 | print ("\n".join(map(str, result))) -------------------------------------------------------------------------------- /AjeshKumarS/jumping-on-the-clouds.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n,k = input().strip().split(' ') 7 | n,k = [int(n),int(k)] 8 | c = [int(c_temp) for c_temp in input().strip().split(' ')] 9 | 10 | i = 0 11 | e = 100 12 | while(ix2 and v1>=v2) or (x2>x1 and v2>=v1)): 9 | return "NO" 10 | else: 11 | for i in range(10000): 12 | p1+=v1 13 | p2+=v2 14 | if(p1==p2): 15 | return "YES" 16 | return "NO" 17 | 18 | x1, v1, x2, v2 = input().strip().split(' ') 19 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 20 | result = kangaroo(x1, v1, x2, v2) 21 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/mars-exploration.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | S = input().strip() 7 | l = len(S) 8 | c=0 9 | for i in range(0,l-1,3): 10 | s = S[i:i+4] 11 | if s[0] != 'S': 12 | c=c+1 13 | if s[1] != 'O': 14 | c=c+1 15 | if s[2] != 'S': 16 | c=c+1 17 | print(c) -------------------------------------------------------------------------------- /AjeshKumarS/migratory-birds.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def migratoryBirds(n, ar): 6 | count = [0,0,0,0,0,0] 7 | for t in ar: 8 | count[t] += 1 9 | return count.index(max(count)) 10 | 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = migratoryBirds(n, ar) 14 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/mini-max-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | arr = list(map(int, input().strip().split(' '))) 6 | ar = sorted(arr) 7 | s1 = 0 8 | s2 = 0 9 | for i in range(len(arr)-1): 10 | s1+=ar[i] 11 | s2+=ar[i+1] 12 | print(s1, s2) -------------------------------------------------------------------------------- /AjeshKumarS/picking-numbers.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | a = [int(a_temp) for a_temp in input().strip().split(' ')] 8 | 9 | max = 0 10 | x = 0 11 | for i in a: 12 | x = a.count(i) + a.count(i-1) 13 | if(x>max): 14 | max = x 15 | print(max) -------------------------------------------------------------------------------- /AjeshKumarS/plus-minus.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def result(x, ar): 6 | a=b=c=0 7 | for i in range(x): 8 | if(ar[i]<0): 9 | a+=1 10 | elif(ar[i]>0): 11 | b+=1 12 | else: 13 | c+=1 14 | print("{}\n{}\n{}".format(b/x,a/x,c/x)) 15 | 16 | 17 | n = int(input().strip()) 18 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 19 | result(n, arr) -------------------------------------------------------------------------------- /AjeshKumarS/readme.md: -------------------------------------------------------------------------------- 1 | Hi, I am Ajesh Kumar S. I am from CSA. I love programming as well as web development. My favourite language is PHP. But now I am focusing on Python. I love Open Source Initiatives. And I am looking forward to be a part of FOSS MEC. -------------------------------------------------------------------------------- /AjeshKumarS/repeated-string.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def cc(s ,l): 6 | ct = 0 7 | for i in range(l): 8 | if(s[i] is 'a'): 9 | ct+=1 10 | return ct 11 | 12 | s = input().strip() 13 | n = int(input().strip()) 14 | if(len(s)>=n): 15 | print(cc(s,n)) 16 | else: 17 | print(cc(s,len(s))*(n//len(s)) + cc(s,n%len(s))) -------------------------------------------------------------------------------- /AjeshKumarS/save-the-prisoner.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def saveThePrisoner(n, m, s): 6 | return (m+s-2)%n+1 7 | 8 | t = int(input().strip()) 9 | for a0 in range(t): 10 | n, m, s = input().strip().split(' ') 11 | n, m, s = [int(n), int(m), int(s)] 12 | result = saveThePrisoner(n, m, s) 13 | print(result) 14 | -------------------------------------------------------------------------------- /AjeshKumarS/sequence-equation.py: -------------------------------------------------------------------------------- 1 | def pp(i,p): 2 | return p.index(i)+1 3 | 4 | n = int(input()) 5 | p = [int(x) for x in input().split()] 6 | 7 | for i in range(1,n+1): 8 | print(pp(pp(i,p),p)) -------------------------------------------------------------------------------- /AjeshKumarS/sherlock-and-squares.py: -------------------------------------------------------------------------------- 1 | import math 2 | t = int(input()) 3 | 4 | for _ in range(t): 5 | a,b = [int(x) for x in input().split()] 6 | ar = math.ceil(math.sqrt(a)) 7 | br = math.floor(math.sqrt(b)) 8 | 9 | print(br - ar + 1) -------------------------------------------------------------------------------- /AjeshKumarS/simple-array-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def simpleArraySum(n, ar): 6 | s = 0 7 | for x in range(n): 8 | s+=ar[x] 9 | return s 10 | 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = simpleArraySum(n, ar) 14 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/sock-merchant.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def sockMerchant(n, ar): 6 | ct = 0 7 | for x in set(ar): 8 | ct+=(ar.count(x))//2 9 | return ct 10 | 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = sockMerchant(n, ar) 14 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/solve-me-first.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | return a+b 3 | 4 | 5 | num1 = int(input()) 6 | num2 = int(input()) 7 | res = solveMeFirst(num1,num2) 8 | print(res) -------------------------------------------------------------------------------- /AjeshKumarS/staircase.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | for x in range(n): 8 | print(" "*(n-x-1) + "#"*(x+1)) -------------------------------------------------------------------------------- /AjeshKumarS/super-reduced-string.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def super_reduced_string(s): 6 | res = [] 7 | for c in s: 8 | if res and res[len(res)-1] == c: # peek what's on top 9 | res.pop() 10 | else: 11 | res.append(c) 12 | st = '' 13 | for x in res: 14 | st+=x 15 | if(st is ''): 16 | return 'Empty String' 17 | else: 18 | return st 19 | 20 | s = input().strip() 21 | result = super_reduced_string(s) 22 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/taum-and-bday.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | t = int(input().strip()) 7 | for a0 in range(t): 8 | b,w = input().strip().split(' ') 9 | b,w = [int(b),int(w)] 10 | x,y,z = input().strip().split(' ') 11 | x,y,z = [int(x),int(y),int(z)] 12 | xa = min(x,y+z) 13 | ya = min(y,x+z) 14 | print(b*xa + w*ya) -------------------------------------------------------------------------------- /AjeshKumarS/the-hurdle-race.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n,k = input().strip().split(' ') 7 | n,k = [int(n),int(k)] 8 | height = list(map(int, input().strip().split(' '))) 9 | 10 | if(max(height)-k > 0): 11 | print(max(height)-k) 12 | else: 13 | print(0) -------------------------------------------------------------------------------- /AjeshKumarS/time-conversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def timeConversion(s): 6 | hh = int(s[0:2]) 7 | p = s[8:] 8 | y = '00' 9 | if(p == 'PM'): 10 | if(hh == 12): 11 | return str(hh) + s[2:8] 12 | else: 13 | return str(hh+12) + s[2:8] 14 | elif(p == 'AM'): 15 | if(hh == 12): 16 | y == '00' 17 | elif(hh<11): 18 | y = '0' + str(hh) 19 | else: 20 | y = str(hh) 21 | return y + s[2:8] 22 | 23 | s = input().strip() 24 | result = timeConversion(s) 25 | print(result) -------------------------------------------------------------------------------- /AjeshKumarS/utopian-tree.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | t = int(input().strip()) 7 | for a0 in range(t): 8 | n = int(input().strip()) 9 | h = 1 10 | for i in range(1, n+1): 11 | if(i%2 is 1): 12 | h*=2 13 | else: 14 | h+=1 15 | print(h) -------------------------------------------------------------------------------- /AjeshKumarS/viral-advertising.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | 3 | c = 5 4 | l = 0 5 | for i in range(1, n+1): 6 | l+=c//2 7 | c=(c//2)*3 8 | print(l) -------------------------------------------------------------------------------- /AlbertBGeorge/a-very-big-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | sum = 0 7 | for i in range(n) : 8 | sum += ar[i] 9 | return sum 10 | # Complete this function 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = aVeryBigSum(n, ar) 15 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/apple-and-orange.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import sys 4 | 5 | 6 | s,t = input().strip().split(' ') 7 | s,t = [int(s),int(t)] 8 | a,b = input().strip().split(' ') 9 | a,b = [int(a),int(b)] 10 | m,n = input().strip().split(' ') 11 | m,n = [int(m),int(n)] 12 | apple = map(int, input().strip().split(' ')) 13 | orange = map(int,input().strip().split(' ')) 14 | ans0 = ans1 = 0 15 | for i in apple: 16 | if a + i >= s and a + i <= t: 17 | ans0 += 1 18 | for i in orange: 19 | if b + i >= s and b + i <= t: 20 | ans1 += 1 21 | print(ans0) 22 | print(ans1) -------------------------------------------------------------------------------- /AlbertBGeorge/between-two-sets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getTotalX(a, b): 6 | c = 0 7 | x = sorted(a) 8 | y = sorted(b) 9 | for i in range(x[len(a)-1], y[0]+1): 10 | for j in a: 11 | if(i%j != 0): 12 | break 13 | else: 14 | for j in b: 15 | if(j%i != 0): 16 | break 17 | else: 18 | c+=1 19 | return c 20 | 21 | if __name__ == "__main__": 22 | n, m = input().strip().split(' ') 23 | n, m = [int(n), int(m)] 24 | a = list(map(int, input().strip().split(' '))) 25 | b = list(map(int, input().strip().split(' '))) 26 | total = getTotalX(a, b) 27 | print(total) -------------------------------------------------------------------------------- /AlbertBGeorge/birthday-cake-candles.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def birthdayCakeCandles(n, ar): 6 | count = 0 7 | # Complete this function 8 | m = max(ar) 9 | for i in ar : 10 | if i == m : 11 | count += 1 12 | return count 13 | 14 | 15 | n = int(input().strip()) 16 | ar = list(map(int, input().strip().split(' '))) 17 | result = birthdayCakeCandles(n, ar) 18 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/bon-appetit.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def bonAppetit(n, k, b, ar): 6 | # Complete this function 7 | bill = int(sum(ar)) - int(ar[k]) 8 | pay = int(bill/2) 9 | if pay == b : 10 | return "Bon Appetit" 11 | else : 12 | return b-pay 13 | 14 | 15 | n, k = input().strip().split(' ') 16 | n, k = [int(n), int(k)] 17 | ar = list(map(int, input().strip().split(' '))) 18 | b = int(input().strip()) 19 | result = bonAppetit(n, k, b, ar) 20 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/breaking-best-and-worst-records.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getRecord(s): 6 | # Complete this function 7 | h = l = s[0] 8 | ch = cl = 0 9 | 10 | for i in range(len(s)): 11 | if s[i] > h : 12 | h = s[i] 13 | ch += 1 14 | elif s[i] < l : 15 | l = s[i] 16 | cl += 1 17 | return [ch, cl] 18 | 19 | 20 | n = int(input().strip()) 21 | s = list(map(int, input().strip().split(' '))) 22 | result = getRecord(s) 23 | print (" ".join(map(str, result))) 24 | -------------------------------------------------------------------------------- /AlbertBGeorge/compare-the-triplets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | alPoint = 0 7 | boPoint = 0 8 | if a0 > b0 : 9 | alPoint += 1 10 | elif a0 < b0 : 11 | boPoint += 1 12 | if a1 > b1 : 13 | alPoint += 1 14 | elif a1 < b1 : 15 | boPoint += 1 16 | if a2 > b2 : 17 | alPoint += 1 18 | elif a2 < b2 : 19 | boPoint += 1 20 | return alPoint, boPoint 21 | # Complete this function 22 | 23 | a0, a1, a2 = input().strip().split(' ') 24 | a0, a1, a2 = [int(a0), int(a1), int(a2)] 25 | b0, b1, b2 = input().strip().split(' ') 26 | b0, b1, b2 = [int(b0), int(b1), int(b2)] 27 | result = solve(a0, a1, a2, b0, b1, b2) 28 | print (" ".join(map(str, result))) 29 | -------------------------------------------------------------------------------- /AlbertBGeorge/day-of-the-programmer.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(year): 6 | if (year == 1918): 7 | return '26.09.1918' 8 | elif((year<=1917) & (year%4==0)) or ((year>1918) & (year%400==0 or ((year%4 == 0) & (year%100 != 0)))): 9 | return '12.09.{}'.format(year) 10 | else: 11 | return '13.09.{}'.format(year) 12 | 13 | 14 | year = int(input().strip()) 15 | result = solve(year) 16 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/diagonal-difference.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def result(x, arr) : 6 | maindia = offdia = 0 7 | for i in range(x) : 8 | maindia += arr[i][i] 9 | offdia += arr[i][x-i-1] 10 | diff = maindia - offdia 11 | if diff >= 0: 12 | return diff 13 | else : 14 | return (-1*diff) 15 | n = int(input().strip()) 16 | a = [] 17 | for a_i in range(n): 18 | a_t = [int(a_temp) for a_temp in input().strip().split(' ')] 19 | a.append(a_t) 20 | print(result(n, a)) 21 | -------------------------------------------------------------------------------- /AlbertBGeorge/divisible-sum-pairs.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def divisibleSumPairs(n, k, ar): 6 | # Complete this function 7 | count = 0 8 | for i in range(n) : 9 | p = 0 10 | while p < i : 11 | if (ar[p]+ar[i]) % k == 0 : 12 | count += 1 13 | 14 | p += 1 15 | return count 16 | 17 | 18 | n, k = input().strip().split(' ') 19 | n, k = [int(n), int(k)] 20 | ar = list(map(int, input().strip().split(' '))) 21 | result = divisibleSumPairs(n, k, ar) 22 | print(result) 23 | -------------------------------------------------------------------------------- /AlbertBGeorge/grading.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | memo = [] 3 | lst = [] 4 | for i in range(n): 5 | x = int(input()) 6 | memo.insert(i, x) 7 | i+=1 8 | for x in memo: 9 | p = x%5 10 | if x < 38 : 11 | lst.append(x) 12 | continue 13 | 14 | if p > 2 : 15 | x -= p 16 | x += 5 17 | lst.append(x) 18 | for u in lst: 19 | print(u) -------------------------------------------------------------------------------- /AlbertBGeorge/hr-submissions.txt: -------------------------------------------------------------------------------- 1 | https://www.hackerrank.com/challenges/solve-me-first/submissions/code/53723619 2 | https://www.hackerrank.com/challenges/simple-array-sum/submissions/code/53724125 3 | https://www.hackerrank.com/challenges/compare-the-triplets/submissions/code/53724657 4 | https://www.hackerrank.com/challenges/a-very-big-sum/submissions/code/53724968 5 | https://www.hackerrank.com/challenges/diagonal-difference/submissions/code/53725680 6 | https://www.hackerrank.com/challenges/diagonal-difference/submissions/code/53725680 7 | https://www.hackerrank.com/challenges/staircase/submissions/code/53726360 8 | https://www.hackerrank.com/challenges/mini-max-sum/submissions/code/54487172 9 | https://www.hackerrank.com/challenges/birthday-cake-candles/submissions/code/54487452 10 | https://www.hackerrank.com/challenges/time-conversion/submissions/code/54489556 11 | https://www.hackerrank.com/challenges/grading/submissions/code/55389563 12 | https://www.hackerrank.com/challenges/apple-and-orange/submissions/code/55957255 13 | https://www.hackerrank.com/challenges/kangaroo/submissions/code/56327616 14 | https://www.hackerrank.com/challenges/between-two-sets/submissions/code/56327774 15 | https://www.hackerrank.com/challenges/breaking-best-and-worst-records/submissions/code/56328078 16 | https://www.hackerrank.com/challenges/the-birthday-bar/submissions/code/56328396 17 | https://www.hackerrank.com/challenges/divisible-sum-pairs/submissions/code/56328730 18 | https://www.hackerrank.com/challenges/migratory-birds/submissions/code/56332341 19 | https://www.hackerrank.com/challenges/day-of-the-programmer/submissions/code/56334122 20 | https://www.hackerrank.com/challenges/bon-appetit/submissions/code/56334911 -------------------------------------------------------------------------------- /AlbertBGeorge/kangaroo.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def kangaroo(x1, v1, x2, v2): 6 | p1 = x1 7 | p2 = x2 8 | if((x1>x2 and v1>=v2) or (x2>x1 and v2>=v1)): 9 | return "NO" 10 | else: 11 | for i in range(10000): 12 | p1+=v1 13 | p2+=v2 14 | if(p1==p2): 15 | return "YES" 16 | return "NO" 17 | 18 | x1, v1, x2, v2 = input().strip().split(' ') 19 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 20 | result = kangaroo(x1, v1, x2, v2) 21 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/migratory-birds.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def migratoryBirds(n, ar): 6 | count = [0,0,0,0,0,0] 7 | for t in ar: 8 | count[t] += 1 9 | return count.index(max(count)) 10 | 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = migratoryBirds(n, ar) 14 | print(result) -------------------------------------------------------------------------------- /AlbertBGeorge/mini-max-sum.py: -------------------------------------------------------------------------------- 1 | a = [int(x) for x in input().split()] 2 | b = [] 3 | for i in a : 4 | b.append(sum(a) - i) 5 | print(min(b), max(b)) -------------------------------------------------------------------------------- /AlbertBGeorge/plus-minus.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 8 | 9 | pv = nv = zr = 0 10 | for i in range(n) : 11 | if arr[i] > 0 : 12 | pv += 1 13 | elif arr[i] < 0 : 14 | nv += 1 15 | else : 16 | zr += 1 17 | print(pv/n) 18 | print(nv/n) 19 | print(zr/n) 20 | -------------------------------------------------------------------------------- /AlbertBGeorge/readme.md: -------------------------------------------------------------------------------- 1 | ## Hey guys! 2 | 3 | I'm **Albert B George**, CS 1B. 4 | 5 |

Web Developer with experience in Python, Javascript, HTML5, PHP. I'm passionate about learning and building new things.

6 | 7 | Some of my experiences: 8 | 9 | * Languages: Python, C++, Javascript 10 | * Front-end frameworks: jQuery, Bootstrap 11 | * Cloud implementation: Amazon AWS, Azure, Digital Ocean 12 | * Databases: Oracle, MySQL 13 | * Payment integration: Braintree, PayPal 14 | * OS: Ubuntu, Windows 15 | * Version Control: Git 16 | 17 | ## Contact: 18 | 19 | [Telegram](https://t.me/albertbgeorge "Telegram @albertbgeorge")
20 | [Twitter](https://twitter.com/AlbertBGeorge "Twitter handle @AlbertBGeorge")
21 | [Personal Website](https://www.albertbgeorge.com "Website")
22 | [Blog](https://www.albertbgeorge.github.io "Albert's personal blog") -------------------------------------------------------------------------------- /AlbertBGeorge/simple-array-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def simpleArraySum(n, ar): 6 | sum = 0 7 | for i in range(n): 8 | sum += int(ar[i]) 9 | return sum 10 | # Complete this function 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = simpleArraySum(n, ar) 15 | print(result) 16 | -------------------------------------------------------------------------------- /AlbertBGeorge/solve-me-first.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | return a+b 3 | # Hint: Type return a+b below 4 | 5 | 6 | num1 = int(input()) 7 | num2 = int(input()) 8 | res = solveMeFirst(num1,num2) 9 | print(res) -------------------------------------------------------------------------------- /AlbertBGeorge/staircase.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | for x in range(n): 8 | print(" "*(n-x-1) + "#"*(x+1)) -------------------------------------------------------------------------------- /AlbertBGeorge/the-birthday-bar.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(n, s, d, m): 6 | # Complete this function 7 | i = 0 8 | ct = 0 9 | while((i+m)<=n): 10 | sum = 0 11 | for x in range(m): 12 | sum+=s[i+x] 13 | 14 | if(sum is d): 15 | ct+=1 16 | i+=1 17 | return ct 18 | 19 | 20 | n = int(input().strip()) 21 | s = list(map(int, input().strip().split(' '))) 22 | d, m = input().strip().split(' ') 23 | d, m = [int(d), int(m)] 24 | result = solve(n, s, d, m) 25 | print(result) 26 | -------------------------------------------------------------------------------- /AlbertBGeorge/time-conversion.py: -------------------------------------------------------------------------------- 1 | time = input() 2 | hh = time[0:2] 3 | mm = time[3:5] 4 | ss = time[6:8] 5 | if time[8:] == "PM" and hh != "12" : 6 | hh = str(int(hh)+12) 7 | if time[8:] == "AM" and hh == "12" : 8 | hh = "00" 9 | 10 | print("{}:{}:{}".format(hh,mm,ss)) -------------------------------------------------------------------------------- /AshmiFathima/AVeryBigSum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | sum=0 7 | for i in range(n): 8 | sum=sum+ar[i] 9 | return sum 10 | 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = aVeryBigSum(n, ar) 15 | print(result) 16 | -------------------------------------------------------------------------------- /AshmiFathima/AppleAndOrange.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | using namespace std; 6 | 7 | 8 | int main(){ 9 | int s; 10 | int t; 11 | cin >> s >> t; 12 | int a; 13 | int b; 14 | cin >> a >> b; 15 | int m; 16 | int n; 17 | cin >> m >> n; 18 | int applecount=0; 19 | int orangecount=0; 20 | int i,d; 21 | for(i=0;i>d; 24 | d+=a; 25 | if(d>=s && d<=t) 26 | applecount++; 27 | } 28 | for(i=0;i>d; 31 | d+=b; 32 | if(d>=s && d<=t) 33 | orangecount++; 34 | } 35 | cout< 2 | 3 | using namespace std; 4 | 5 | int main() 6 | { 7 | int n,highest,lowest; 8 | int x=0,y=0; 9 | cin >> n; 10 | int s[n]; 11 | 12 | for(int i = 0; i < n; i++){ 13 | cin >> s[i]; 14 | } 15 | highest=lowest=s[0]; 16 | 17 | for(int i=0;i highest) 20 | { 21 | highest = s[i]; 22 | x++; 23 | } 24 | else if (s[i] < lowest) 25 | { 26 | lowest = s[i]; 27 | y++; 28 | 29 | } 30 | } 31 | cout< 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | string s; 11 | cin >> s; 12 | int len=s.length(); 13 | int c,i; 14 | c=1; 15 | for(i=0;i 2 | 3 | #include 4 | 5 | 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | int q; 11 | cin >> q; 12 | for(int a0 = 0; a0 < q; a0++){ 13 | int x; 14 | int y; 15 | int z; 16 | cin >> x >> y >> z; 17 | if(abs(x-z)==abs(y-z)) 18 | cout<<"Mouse C"< 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | int a_triplet[3]; 7 | int b_triplet[3]; 8 | int alicepoints=0; 9 | int bobpoints=0; 10 | int i; 11 | for(i=0;i<3;++i) 12 | cin>>a_triplet[i]; 13 | for(i=0;i<3;++i) 14 | cin>>b_triplet[i]; 15 | for(i=0;i<3;++i) 16 | { 17 | if(a_triplet[i]>b_triplet[i]) 18 | alicepoints++; 19 | if(a_triplet[i] 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void insertionSort(int N, int arr[]) { 8 | int i,j; 9 | int value; 10 | for(i=1;i=0 && value 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | int year; 7 | cin >> year; 8 | int daysFeb,date; 9 | if(year==1918) 10 | daysFeb=15; 11 | else if (year<1918) 12 | { 13 | if(year%4==0) 14 | daysFeb=29; 15 | else 16 | daysFeb=28; 17 | } 18 | else 19 | { 20 | if((year%4==0 && year%100!=0)||year%400==0) 21 | daysFeb=29; 22 | else 23 | daysFeb=28; 24 | } 25 | date=256-daysFeb-215; 26 | cout< 3 | 4 | using namespace std; 5 | 6 | 7 | int main(){ 8 | int n; 9 | cin >> n; 10 | int a[n][n]; 11 | int d1=0; 12 | int d2=0; 13 | 14 | for(int i=0;i> a[i][j]; 17 | if(i==j) 18 | d1+=a[i][j]; 19 | if(i+j==n-1) 20 | d2+=a[i][j]; 21 | } 22 | } 23 | cout< 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | int n; 7 | int k; 8 | cin >> n >> k; 9 | int a[n]; 10 | int i,j,c=0; 11 | for(i = 0; i < n; i++) 12 | cin >> a[i]; 13 | for(i = 0; i < n; i++) 14 | { 15 | for(j=i+1;j 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | string s; 11 | cin >> s; 12 | int len=s.length(); 13 | int a=int(floor(sqrt(len))); 14 | int b=int(ceil(sqrt(len))); 15 | int r=0,c=0,row,col; 16 | for(row=a;row<=b;++row){ 17 | for(col=row;col<=b;++col){ 18 | if(row*col>=len ){ 19 | r=row; 20 | c=col; 21 | } 22 | } 23 | } 24 | for (int i=0;i=38 and grades_t%5>=3): 10 | while(grades_t%5!=0): 11 | grades_t=grades_t+1 12 | print grades_t 13 | -------------------------------------------------------------------------------- /AshmiFathima/Kangaroo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | int x1; 7 | int v1; 8 | int x2; 9 | int v2; 10 | cin >> x1 >> v1 >> x2 >> v2; 11 | int c; 12 | int k1 = x1; 13 | int k2 = x2; 14 | if(x2>x1&&v2>v1) 15 | cout<<"NO"; 16 | else 17 | { 18 | for(int i=0;i<10000;i++) 19 | { 20 | k1+=v1; 21 | k2+=v2; 22 | if(k1==k2) 23 | { 24 | c++; 25 | break; 26 | } 27 | } 28 | if(c!=0) 29 | cout<<"YES"; 30 | else 31 | cout<<"NO"; 32 | return 0; 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /AshmiFathima/MarsExploration.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import sys 4 | 5 | s = raw_input().strip() 6 | l=len(s) 7 | if(l%3==0 and l<=99): 8 | n=l/3 9 | v="SOS"*n 10 | c=0 11 | for i in range(l): 12 | if(s[i]!=v[i]): 13 | c+=1 14 | print c 15 | -------------------------------------------------------------------------------- /AshmiFathima/MigratoryBirds.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | from collections import Counter 3 | n = int(raw_input().strip()) 4 | a = Counter(map(int, raw_input().strip().split(' '))) 5 | 6 | print a.most_common()[0][0] 7 | -------------------------------------------------------------------------------- /AshmiFathima/MiniMaxSum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import sys 4 | 5 | arr = map(int, raw_input().strip().split(' ')) 6 | n=sum(arr) 7 | print n-(max(arr)), n-(min(arr)) 8 | -------------------------------------------------------------------------------- /AshmiFathima/PlusMinus.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | float n,a,b,c; 11 | cin >> n; 12 | vector arr(n); 13 | for(int arr_i = 0;arr_i < n;arr_i++){ 14 | cin >> arr[arr_i]; 15 | } 16 | for (int i=0;i0) 18 | a++; 19 | else if(arr[i]<0) 20 | b++; 21 | else if (arr[i]==0) 22 | c++; 23 | } 24 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int solveMeFirst(int a, int b) { 10 | return a+b; 11 | 12 | } 13 | int main() { 14 | int num1, num2; 15 | int sum; 16 | cin>>num1>>num2; 17 | sum = solveMeFirst(num1,num2); 18 | cout< 3 | 4 | using namespace std; 5 | 6 | 7 | int main(){ 8 | int n,k,i,max,a; 9 | cin >> n >> k; 10 | int height[100]; 11 | for(i = 0;i < n;i++) 12 | cin >> height[i]; 13 | max=height[0]; 14 | for(i=0;imax) 16 | max=height[i]; 17 | a=max-k; 18 | if(a>0) 19 | cout<=s and dist<=t: 19 | apple_count+=1 20 | 21 | for orange_d in orange: 22 | dist=b+(orange_d) 23 | if dist>=s and dist<=t: 24 | orange_count+=1 25 | 26 | print(apple_count) 27 | print(orange_count) 28 | 29 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/between-two-sets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getTotalX(a, b): 6 | # Complete this function 7 | max_a,min_b,final_count=max(a),min(b),0 8 | 9 | for i in range(max_a,min_b+1): 10 | flag=1 11 | for a1 in a: 12 | if i%a1!=0: 13 | flag=0 14 | break 15 | 16 | if flag==1: 17 | for b1 in b: 18 | if b1%i!=0: 19 | flag=0 20 | break 21 | 22 | if flag==1: 23 | final_count+=1 24 | 25 | return(final_count) 26 | 27 | if __name__ == "__main__": 28 | n, m = input().strip().split(' ') 29 | n, m = [int(n), int(m)] 30 | a = list(map(int, input().strip().split(' '))) 31 | b = list(map(int, input().strip().split(' '))) 32 | total = getTotalX(a, b) 33 | print(total) 34 | 35 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/bon-appetit.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def bonAppetit(n, k, b, ar): 6 | # Complete this function 7 | ar[k]=0 8 | b_actual=sum(ar)//2 9 | if b==b_actual: 10 | return("Bon Appetit") 11 | else: 12 | return(b-b_actual) 13 | 14 | n, k = input().strip().split(' ') 15 | n, k = [int(n), int(k)] 16 | ar = list(map(int, input().strip().split(' '))) 17 | b = int(input().strip()) 18 | result = bonAppetit(n, k, b, ar) 19 | print(result) 20 | 21 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/breaking-best-and-worst-record.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getRecord(s): 6 | # Complete this function 7 | max,max_count=s[0],0 8 | min,min_count=s[0],0 9 | for item in s: 10 | if item>max: 11 | max=item 12 | max_count+=1 13 | elif item=1700 and year<=1917: 10 | if year%4==0: 11 | return("12.09.{}".format(year)) 12 | else: 13 | return("13.09.{}".format(year)) 14 | elif year>=1919 and year<=2700: 15 | if year%400==0: 16 | return("12.09.{}".format(year)) 17 | elif year%4==0 and year%100!=0: 18 | return("12.09.{}".format(year)) 19 | else: 20 | return("13.09.{}".format(year)) 21 | 22 | year = int(input().strip()) 23 | result = solve(year) 24 | print(result) 25 | 26 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/drawing-book.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(n, p): 6 | # Complete this function 7 | count_f,count_b=0,0 8 | for i in range(1,n+1): 9 | if i==p: 10 | break 11 | elif (i!=p and i%2!=0) or (i!=p and i==1): 12 | count_f+=1 13 | 14 | for j in range(n,0,-1): 15 | if j==p: 16 | break 17 | elif j!=p and j%2==0: 18 | count_b+=1 19 | 20 | count=[count_f,count_b] 21 | return(min(count)) 22 | n = int(input().strip()) 23 | p = int(input().strip()) 24 | result = solve(n, p) 25 | print(result) 26 | 27 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/grading.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(grades): 6 | # Complete this function 7 | final_list=[] 8 | for i in grades: 9 | if i<38: 10 | final_list.append(i) 11 | else: 12 | rem=i%5 13 | if rem<3: 14 | final_list.append(i) 15 | elif rem==3: 16 | final_list.append(i+2) 17 | else: 18 | final_list.append(i+1) 19 | return(final_list) 20 | 21 | 22 | n = int(input().strip()) 23 | grades = [] 24 | grades_i = 0 25 | for grades_i in range(n): 26 | grades_t = int(input().strip()) 27 | grades.append(grades_t) 28 | result = solve(grades) 29 | print ("\n".join(map(str, result))) 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/kangaroo.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def kangaroo(x1, v1, x2, v2): 6 | # Complete this function 7 | if x1==x2 and v1==v2: 8 | return("YES") 9 | elif (x1x2 and v1>v2) or (x1!=x2 and v1==v2): 10 | return("NO") 11 | else: 12 | check=(x1-x2)%(v2-v1) 13 | if check==0: 14 | return("YES") 15 | else: 16 | return("NO") 17 | 18 | 19 | x1, v1, x2, v2 = input().strip().split(' ') 20 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 21 | result = kangaroo(x1, v1, x2, v2) 22 | print(result) 23 | 24 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/migratory-birds.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def migratoryBirds(n, ar): 6 | # Complete this function 7 | count_1,count_2,count_3,count_4,count_5=0,0,0,0,0 8 | for i in ar: 9 | if i==1: 10 | count_1+=1 11 | elif i==2: 12 | count_2+=1 13 | elif i==3: 14 | count_3+=1 15 | elif i==4: 16 | count_4+=1 17 | else: 18 | count_5+=1 19 | count_list=[count_1,count_2,count_3,count_4,count_5] 20 | n_count=len(count_list) 21 | champ=0 22 | 23 | for j in range(n_count): 24 | if count_list[j]>champ: 25 | champ=count_list[j] 26 | temp=j+1 27 | 28 | return(temp) 29 | 30 | n = int(input().strip()) 31 | ar = list(map(int, input().strip().split(' '))) 32 | result = migratoryBirds(n, ar) 33 | print(result) 34 | 35 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/sock-merchant.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def sockMerchant(n, ar): 6 | # Complete this function 7 | count=0 8 | for i in range(n): 9 | if i==n-1: 10 | break 11 | elif ar[i]!=0: 12 | for j in range(i+1,n): 13 | if ar[i]==ar[j]: 14 | count+=1 15 | ar[i],ar[j]=0,0 16 | break 17 | return(count) 18 | 19 | n = int(input().strip()) 20 | ar = list(map(int, input().strip().split(' '))) 21 | result = sockMerchant(n, ar) 22 | print(result) 23 | 24 | -------------------------------------------------------------------------------- /JoyalAJohney/implementation/the-birthday-bar.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(n, s, d, m): 6 | # Complete this function 7 | count=0 8 | for i in range(n-(m-1)): 9 | if d==sum(s[i:m+i]): 10 | count+=1 11 | return(count) 12 | 13 | n = int(input().strip()) 14 | s = list(map(int, input().strip().split(' '))) 15 | d, m = input().strip().split(' ') 16 | d, m = [int(d), int(m)] 17 | result = solve(n, s, d, m) 18 | print(result) 19 | 20 | -------------------------------------------------------------------------------- /JoyalAJohney/readme.md: -------------------------------------------------------------------------------- 1 | Hiii I'm Joyal A Johney of CS1A. 2 | I love programming and love to contribute to open source. 3 | I'm actually a beginner, So i'm looking forward to learn and grow along with other fellow programmers. 4 | Looking forward to be an active member in FossMec. 5 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/a-very-big-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | # Complete this function 7 | sum=0 8 | for i in range(n): 9 | sum+=ar[i] 10 | return (sum) 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = aVeryBigSum(n, ar) 15 | print(result) 16 | 17 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/birthday-cake-candles.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def birthdayCakeCandles(n, ar): 6 | # Complete this function 7 | max_no,n=max(ar),0 8 | for i in ar: 9 | if i==max_no: 10 | n+=1 11 | return n 12 | 13 | n = int(input().strip()) 14 | ar = list(map(int, input().strip().split(' '))) 15 | result = birthdayCakeCandles(n, ar) 16 | print(result) 17 | 18 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/compare-the-triplets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | # Complete this function 7 | A=[a0,a1,a2] 8 | B=[b0,b1,b2] 9 | a,b=0,0 10 | for i in range(3): 11 | if(A[i]>B[i]): 12 | a+=1 13 | elif(A[i]0): 11 | positive+=1 12 | elif(arr[i]<0): 13 | negative+=1 14 | else: 15 | zero+=1 16 | 17 | print(float("{0:.6f}".format(positive/n))) 18 | print(float("{0:.6f}".format(negative/n))) 19 | print(float("{0:.6f}".format(zero/n))) 20 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/simple-array-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def simpleArraySum(n, ar): 6 | # Complete this function 7 | sum=0 8 | for i in range(n): 9 | sum +=ar[i] 10 | return sum 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = simpleArraySum(n, ar) 15 | print(result) 16 | 17 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/solve-me-first.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | return(a+b) 3 | # Hint: Type return a+b below 4 | 5 | 6 | num1 = int(input()) 7 | num2 = int(input()) 8 | res = solveMeFirst(num1,num2) 9 | print(res) 10 | 11 | -------------------------------------------------------------------------------- /JoyalAJohney/warmup/time-conversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def timeConversion(s): 6 | # Complete this function 7 | hour=int(s[:2]) 8 | 9 | if(s[-2]=="A"or s[-2]=="a"): 10 | a=s[2:-2] 11 | if(hour==12): 12 | return("00"+a) 13 | else: 14 | return(s[:-2]) 15 | 16 | else: 17 | b=s[2:-2] 18 | if(hour<12): 19 | hour+=12 20 | return(str(hour)+b) 21 | else: 22 | return(s[:-2]) 23 | 24 | s = input().strip() 25 | result = timeConversion(s) 26 | print(result) 27 | -------------------------------------------------------------------------------- /KowalskiA/1.solveMeFirst.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | return(a+b) 3 | 4 | num1 = int(input()) 5 | num2 = int(input()) 6 | res = solveMeFirst(num1,num2) 7 | print(res) 8 | -------------------------------------------------------------------------------- /KowalskiA/10.timeConversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def timeConversion(s): 6 | hours=int(s[:2]) 7 | t=s[8:] 8 | if t=='AM': 9 | if hours==12: 10 | return('00'+s[2:8]) 11 | else: 12 | return(s[:8]) 13 | else: 14 | if hours!=12: 15 | return(str(12+hours)+s[2:8]) 16 | else: 17 | return(s[:8]) 18 | 19 | 20 | 21 | s =(input().strip()) 22 | result = timeConversion(s) 23 | print(result) 24 | -------------------------------------------------------------------------------- /KowalskiA/11.gradingStudents.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(grades): 6 | # Complete this function 7 | for i in range(n): 8 | if grades[i]>=38: 9 | for p in range(1,3): 10 | if (grades[i]+p)%5==0: 11 | grades[i]+=p 12 | return(grades) 13 | n = int(input().strip()) 14 | grades = [] 15 | grades_i = 0 16 | for grades_i in range(n): 17 | grades_t = int(input().strip()) 18 | grades.append(grades_t) 19 | result = solve(grades) 20 | print ("\n".join(map(str, result))) 21 | 22 | 23 | -------------------------------------------------------------------------------- /KowalskiA/12.appleAndOrange: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | ap=ma=0 6 | s,t = input().strip().split(' ') 7 | s,t = [int(s),int(t)] 8 | a,b = input().strip().split(' ') 9 | a,b = [int(a),int(b)] 10 | m,n = input().strip().split(' ') 11 | m,n = [int(m),int(n)] 12 | apple = [int(apple_temp) for apple_temp in input().strip().split(' ')] 13 | orange = [int(orange_temp) for orange_temp in input().strip().split(' ')] 14 | for i in range(m): 15 | if apple[i]>=s-a and apple[i]<=t-a: 16 | ap+=1 17 | for i in range(n): 18 | if orange[i]<=t-b and orange[i]>=s-b: 19 | ma+=1 20 | print(ap) 21 | print(ma) 22 | -------------------------------------------------------------------------------- /KowalskiA/13.kangaroo: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | t=1 5 | def kangaroo(x1, v1, x2, v2): 6 | # Complete this function 7 | for i in range(10000): 8 | x1+=v1 9 | x2+=v2 10 | if x1==x2: 11 | return("YES") 12 | break 13 | if i==9999: 14 | return("NO") 15 | 16 | x1, v1, x2, v2 = input().strip().split(' ') 17 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 18 | result = kangaroo(x1, v1, x2, v2) 19 | print(result) 20 | -------------------------------------------------------------------------------- /KowalskiA/14.betweenTwoSets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getTotalX(a, b): 6 | maxi=max(a) 7 | mini=min(b)+1 8 | c=0 9 | for i in range(maxi,mini): 10 | for j in range(n): 11 | if i%a[j]!=0: 12 | break 13 | else: 14 | if a[j]==a[n-1]: 15 | for k in range(m): 16 | if b[k]%i!=0: 17 | break 18 | else: 19 | if b[k]==b[m-1]: 20 | c+=1 21 | return(c) 22 | 23 | 24 | if __name__ == "__main__": 25 | n, m = input().strip().split(' ') 26 | n, m = [int(n), int(m)] 27 | a = list(map(int, input().strip().split(' '))) 28 | b = list(map(int, input().strip().split(' '))) 29 | total = getTotalX(a, b) 30 | print(total) 31 | -------------------------------------------------------------------------------- /KowalskiA/15.breakingTheRecords.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def getRecord(s): 6 | high=low=s[0] 7 | c=p=0 8 | for i in range(n): 9 | if s[i]>high: 10 | c=c+1 11 | high=s[i] 12 | elif s[i]1918 and (year%400==0 or (year%4==0 and year%100!=0)): 10 | return('12.09.'+ye) 11 | else: 12 | return('13.09.'+ ye) 13 | year = int(input().strip()) 14 | result = solve(year) 15 | print(result) 16 | -------------------------------------------------------------------------------- /KowalskiA/2.simpleArraySum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def simpleArraySum(n, ar): 6 | sum=0 7 | for i in range(n): 8 | sum=ar[i]+sum 9 | return(sum) 10 | n = int(input().strip()) 11 | ar = list(map(int, input().strip().split(' '))) 12 | result = simpleArraySum(n, ar) 13 | print(result) 14 | -------------------------------------------------------------------------------- /KowalskiA/20.bonAppetit.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def bonAppetit(n, k, b, ar): 6 | c=0 7 | for i in range(n): 8 | if i!=k: 9 | c=c+ar[i] 10 | c=c/2 11 | if c==b: 12 | return("Bon Appetit") 13 | else: 14 | return(int(b-c)) 15 | n, k = input().strip().split(' ') 16 | n, k = [int(n), int(k)] 17 | ar = list(map(int, input().strip().split(' '))) 18 | b = int(input().strip()) 19 | result = bonAppetit(n, k, b, ar) 20 | print(result) 21 | -------------------------------------------------------------------------------- /KowalskiA/21.Sockmerchant.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def sockMerchant(n, ar): 6 | count = 0 7 | for a in set(ar): 8 | count+=(ar.count(a))//2 9 | return (count) 10 | n = int(input().strip()) 11 | ar = list(map(int, input().strip().split(' '))) 12 | result = sockMerchant(n, ar) 13 | print(result) 14 | -------------------------------------------------------------------------------- /KowalskiA/22.drawinBook.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(n, p): 6 | d=n//2-p//2 7 | a=min(d,p//2) 8 | return a 9 | n = int(input().strip()) 10 | p = int(input().strip()) 11 | result = solve(n, p) 12 | print(result) 13 | -------------------------------------------------------------------------------- /KowalskiA/3.compareTheTriplets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | A=0 7 | B=0 8 | if a0>b0: 9 | A=A+1 10 | elif b0>a0: 11 | B=B+1 12 | else: 13 | A=0 14 | B=0 15 | if a1>b1: 16 | A=A+1 17 | elif b1>a1: 18 | B=B+1 19 | 20 | if a2>b2: 21 | A=A+1 22 | elif b2>a2: 23 | B=B+1 24 | return(A,B) 25 | a0, a1, a2 = input().strip().split(' ') 26 | a0, a1, a2 = [int(a0), int(a1), int(a2)] 27 | b0, b1, b2 = input().strip().split(' ') 28 | b0, b1, b2 = [int(b0), int(b1), int(b2)] 29 | result = solve(a0, a1, a2, b0, b1, b2) 30 | print (" ".join(map(str, result))) 31 | 32 | 33 | -------------------------------------------------------------------------------- /KowalskiA/4.aVeryBigSum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | 7 | sum=0 8 | for i in range(n): 9 | sum=sum+ar[i] 10 | return(sum) 11 | n = int(input().strip()) 12 | ar = list(map(int, input().strip().split(' '))) 13 | result = aVeryBigSum(n, ar) 14 | print(result) 15 | -------------------------------------------------------------------------------- /KowalskiA/5.diagonalDifference.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import sys 4 | def difference(ar,p): 5 | d1=d2=0 6 | for i in range(p): 7 | d1+=ar[i][i] 8 | d2+=ar[i][p-i-1] 9 | return(abs(d1-d2)) 10 | n = int(raw_input().strip()) 11 | a = [] 12 | for a_i in xrange(n): 13 | a_temp = map(int,raw_input().strip().split(' ')) 14 | a.append(a_temp) 15 | print difference(a,n) 16 | -------------------------------------------------------------------------------- /KowalskiA/6.plusMinus.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | def fraction(a,n): 5 | p=n1=z=0 6 | for i in range(n): 7 | if a[i]>0: 8 | p=p+1 9 | elif a[i]==0: 10 | z=z+1 11 | else: 12 | n1=n1+1 13 | print(p/n) 14 | print(n1/n) 15 | print(z/n) 16 | return(0) 17 | 18 | n = int(input().strip()) 19 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 20 | fraction(arr,n) 21 | -------------------------------------------------------------------------------- /KowalskiA/7.staircase.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | def pattern(n): 5 | for i in range(n): 6 | for p in range(n): 7 | if p 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | using namespace std; 25 | 26 | int main(){ 27 | int s, t; 28 | cin >> s >> t; 29 | int a, b; 30 | cin >> a >> b; 31 | int m, n; 32 | cin >> m >> n; 33 | int apples=0, oranges=0; 34 | int apple[m]; 35 | for(int apple_i = 0;apple_i < m;apple_i++){ 36 | cin >> apple[apple_i]; 37 | if( (apple[apple_i]>0) && ((a+apple[apple_i] >=s) && (a+apple[apple_i] <=t )) ) 38 | apples++; 39 | } 40 | int orange[n]; 41 | for(int orange_i = 0;orange_i < n;orange_i++){ 42 | cin >> orange[orange_i]; 43 | if( (orange[orange_i]<0) && ((b-abs(orange[orange_i]) >=s) && (b-abs(orange[orange_i])<=t)) ) 44 | oranges++; 45 | } 46 | 47 | cout<< apples << endl << oranges; 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /NevilleAntony98/Implementation/between-two-sets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int m, n, x, count=0, flag1=0, flag2=0; 11 | cin>> m >> n; 12 | int A[m], B[n]; 13 | for(int i=0; i> A[i]; 15 | for(int i=0; i> B[i]; 17 | for(int i=A[0]; i <= B[n-1]; i++){ 18 | x = i; 19 | flag1 = 0; 20 | flag2 = 0; 21 | for(int j=0; j 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n; 11 | int max , min, maxrec=0, minrec=0; 12 | cin>> n; 13 | int score[n]; 14 | for(int i=0; i> score[i]; 16 | max = score[0]; 17 | min = score[0]; 18 | for(int i=1; i max){ 20 | max = score[i]; 21 | maxrec++; 22 | } 23 | if(score[i] < min){ 24 | min = score[i]; 25 | minrec++; 26 | } 27 | } 28 | cout<< maxrec << " " << minrec; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /NevilleAntony98/Implementation/divisible-sum-pairs.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n, k, count=0;; 11 | cin>> n >> k; 12 | int ar[n]; 13 | for(int i=0; i> ar[i]; 15 | for(int i=0; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | void grade(int n,int ar[]){ 10 | int tmp, diff; 11 | for(int i =0; i= 38){ 13 | tmp = ar[i] % 10; 14 | if(tmp < 5) 15 | diff = 5 - tmp; 16 | else if(tmp > 5) 17 | diff = 10 - tmp; 18 | else 19 | diff = 0; 20 | if(diff < 3) 21 | ar[i] = ar[i] + diff; 22 | } 23 | } 24 | for(int i=0; i> n; 33 | int ar[n]; 34 | for(int i=0; i> ar[i]; 36 | } 37 | grade(n,ar); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /NevilleAntony98/Implementation/kangaroo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int x1, v1, x2, v2, flag=0; 11 | cin>> x1 >> v1 >> x2 >> v2; 12 | int s1=x1, s2=x2; 13 | if( (v1 <= v2) ) 14 | cout<<"NO"; 15 | else{ 16 | for(int i=0; i < 10000; i++){ 17 | s1 += v1; 18 | s2 += v2; 19 | if(s1 == s2){ 20 | cout<<"YES"; 21 | flag = 1; 22 | break; 23 | } 24 | } 25 | if(flag == 0) 26 | cout<<"NO"; 27 | } 28 | 29 | 30 | 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /NevilleAntony98/Implementation/the-birthday-bar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n, m, d, sum, count=0; 11 | cin>> n; 12 | int bar[n]; 13 | for(int i=0; i> bar[i]; 15 | cin>> d >> m; 16 | for(int i=0; i 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | int n; 7 | long int sum=0; 8 | cin >> n; 9 | long int ar[n]; 10 | for(int ar_i = 0; ar_i < n; ar_i++){ 11 | cin >> ar[ar_i]; 12 | } 13 | for(int ar_i = 0; ar_i < n; ar_i++){ 14 | sum+=ar[ar_i]; 15 | } 16 | cout << sum << endl; 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/birthday-cake-candles.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int birthdayCakeCandles(int n, int ar[]) { 6 | int max=ar[0]; 7 | int count = 0; 8 | for(int i=0; i < n; i++){ 9 | if(ar[i] > max){ 10 | max = ar[i]; 11 | } 12 | } 13 | for(int i=0; i < n; i++){ 14 | if(ar[i] == max) 15 | count++; 16 | } 17 | return count; 18 | 19 | 20 | } 21 | 22 | int main() { 23 | int n; 24 | cin >> n; 25 | int ar[n]; 26 | for(int i = 0; i < n; i++){ 27 | cin >> ar[i]; 28 | } 29 | int result = birthdayCakeCandles(n, ar); 30 | cout << result << endl; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/compare-the-triplets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | void solve(int a0, int a1, int a2, int b0, int b1, int b2){ 6 | int r[2]={0,0}; 7 | if(a0 > b0) 8 | r[0]+=1; 9 | else if(a0 < b0) 10 | r[1]+=1; 11 | if(a1 > b1) 12 | r[0]+=1; 13 | else if(a1 < b1) 14 | r[1]+=1; 15 | if(a2 > b2) 16 | r[0]+=1; 17 | else if(a2 < b2) 18 | r[1]+=1; 19 | for (int i = 0; i < 2; i++) 20 | cout << r[i] << " "; 21 | } 22 | 23 | int main() { 24 | int a0; 25 | int a1; 26 | int a2; 27 | cin >> a0 >> a1 >> a2; 28 | int b0; 29 | int b1; 30 | int b2; 31 | cin >> b0 >> b1 >> b2; 32 | solve(a0, a1, a2, b0, b1, b2); 33 | cout << endl; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/diagonal-difference.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | int n; 11 | int sum1=0; 12 | int sum2 =0; 13 | cin>> n; 14 | int ar[n][n]; 15 | for(int i=0; i>ar[i][j]; 18 | } 19 | } 20 | for (int i = 0; i 2 | 3 | using namespace std; 4 | 5 | int main() { 6 | long int ar[5]; 7 | long int tmp; 8 | for(int i = 0; i < 5; i++){ 9 | cin >> ar[i]; 10 | } 11 | for(int i=0; i<5 ; i++){ 12 | for(int j=0; j<4-i; j++){ 13 | if(ar[j] > ar[j+1]){ 14 | tmp = ar[j]; 15 | ar[j] = ar[j+1]; 16 | ar[j+1] = tmp; 17 | } 18 | 19 | } 20 | } 21 | long int minsum = ar[0] + ar[1] + ar[2] + ar[3]; 22 | long int maxsum = ar[1] + ar[2] + ar[3] + ar[4]; 23 | cout<< minsum << " " << maxsum; 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/plus-minus.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | int main(){ 9 | int n; 10 | float positive=0, negative=0, zero=0; 11 | cin>> n; 12 | int ar[n]; 13 | for(int i=0; i> ar[i]; 15 | for(int i=0; i 0) 19 | positive++; 20 | else 21 | negative++; 22 | } 23 | zero = zero/n; 24 | positive = positive/n; 25 | negative = negative/n; 26 | cout<< positive << endl << negative << endl << zero; 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/simple-array-sum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | 6 | int main() { 7 | int n,sum=0; 8 | cin >> n; 9 | int ar[n]; 10 | for(int ar_i = 0; ar_i < n; ar_i++){ 11 | cin >> ar[ar_i]; 12 | sum=sum+ar[ar_i]; 13 | } 14 | cout << sum << endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /NevilleAntony98/Warmup/solve-me-first.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int solveMeFirst(int a, int b) { 10 | return a+b; 11 | 12 | } 13 | int main() { 14 | int num1, num2; 15 | int sum; 16 | cin>>num1>>num2; 17 | sum = solveMeFirst(num1,num2); 18 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main(){ 10 | int n; 11 | cin >> n; 12 | for(int i=0; i 2 | 3 | using namespace std; 4 | 5 | void timeConversion(char t[]){ 6 | int h = (t[0] - '0')*10 + t[1] - '0'; 7 | if(t[8] == 'A'){ 8 | if(h == 12){ 9 | cout<< "00"; 10 | for(int i=2; i<8; i++) 11 | cout<< t[i]; 12 | 13 | } 14 | else 15 | for(int i=0; i<8; i++) 16 | cout<< t[i]; 17 | } 18 | else{ 19 | if(h != 12) 20 | h += 12; 21 | cout<< h; 22 | for(int i=2; i<8; i++) 23 | cout<< t[i]; 24 | } 25 | } 26 | 27 | 28 | 29 | 30 | 31 | int main() { 32 | char time[10]; 33 | for(int i=0; i<10; i++) 34 | cin>> time[i]; 35 | timeConversion(time); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![FOSSMEC](http://i.imgur.com/k9Tv4zR.jpg) 3 | 4 | # Welcome! 5 | 6 | #### Who are we? 7 | 8 | FOSS MEC consists of a group of bright individuals from all different fields who came together to bring forward tech and Open Source Software at MEC. From people who are working on Government funded Machine Learning Projects to doing Summer of code with Google, to people having their own start-ups and Mentoring in Google Code-In, our club has become a hub of knowledge working for the common goal of bringing forth the importance of Open Source in our college, which is all happening by people volunteering. 9 | 10 | #### Humble Beginning. 11 | 12 | As the most young club at MEC, only 6 months old, we have considerable achievments even though we are a quite young club. From teaching over 70 people to use Git and Github, and conducting an Ethical Hacking workshop by bring the renowned team Bi0s into the college, and taking over college projects to be done using Open Source, we have quite a few acheivements to boast about and we don't plan to stop. 13 | 14 | #### Okay, cool! But how do I get in? 15 | 16 | So coming back to our point of this article. Last year when we began, we had no organised way to select people, we had to manually select the best people from over 200 tech oriented people. We needed determined people who were willing to work for this organisation with their heart and soul. We needed people who were passionate about learning and who were willing to volunteer for Open Source. We needed smart, young minds who were keen on learning and who were always looking for opportunities to move ahead. 17 | 18 | This article is actually a tutorial for selecting a 10-20 able, working students from a pool of over 300 students. Don't worry if you aren't familiar with anything, if you are ready to work for Open Source, you'll have all the oppertunities in the world open for you and people ready to mentor and guide you to achieve it. 19 | 20 | #### What can Open Source offer me? 21 | 22 | * Good Placements? Working for Open Source will make your resume stand out when applying for a job. It'll without no doubt give a boost to your career. 23 | 24 | * Work during college? Working for Open Source organisation can sometimes even land you in a job. If you start contributing to Open Source Organisations, and if you're a good enough developer it can land you in a job, even before your final year. And you don't have to be programmer, if you're good with content writing and a good manager, it could also get you in. 25 | 26 | * Money? Have you heard of Google Summer of Code? Working for Open Source Organisation for a mere 60 days can get you a sum of Rs. 2,00,000. Over 1200 students participate out of which 600 students are from India and there had been GSoC Students from MEC in the past, working for reputed Organisations like Debian and Fedora, which FOSSMEC can get you in touch with. There had been a Ex-MECian, who participated in Google Summer of Code for all of his four years, and when the stipend was Rs 3,50,000. So just imagine four years!! That's 4 X 3,50,000 that's approximately Rs 14,00,000 from working a few months for different Open Source Organisation during college!!! 27 | So first year is not too early to start. Okay, so know the importance of Open Source now? Let's go! 28 | 29 | [Read more about Summer of Code](https://summerofcode.withgoogle.com/) 30 | 31 | ## Task 32 | 33 | * Enroll in the task by adding your details to [This sheet](https://goo.gl/jSZX2b). For reference, we have added a sample task of how we expect the task to be done. 34 | 35 | ### Additional help for this task, you want a helping hand for this tasks? 36 | #### Follow through with this [Small Tutorial](https://www.pluralsight.com/courses/get-involved) 37 | ##### Caution: The instructions are very vague, and the task is excruciatingly hard for beginner, take your time, seek for help to complete it.(Warning: only Algorithmic questions will be valued) You'll have to do group discussions and work together as a team for finishing it. The people who complete this will be considered for entry into FOSS MEC and the top winner will get exciting FOSS MEC Prizes! 38 | 39 | 40 | 41 | ##### Time Required: 1-3 Days (Optional Step). 42 | 43 | * It is best to follow this task on a Linux Machine, which already comes with Git Installed, it's best to install it first and then coming back to do this task. Always remember that this task is not to see who is first but to learn about various aspects of Open Source and Tech and also learn about one Programming Language of your choice along the line. 44 | 45 | ###### Fill in the following sheet, as you move up the task. goo.gl/jSZX2b. 46 | 47 | ##### Time Required: 3 hours - 3 Days. 48 | 49 | * Create a Github Account and fill in the details and set up Git on your local machine and configure it. Learn basic Github commands. (Linux preferred, but can be done on any operating system) 50 | 51 | ##### Time Required: 30 minutes - 2 days. 52 | 53 | * Fork this repository onto your local machine. (This part of the task is given as a full on tutorial [here](https://github.com/FossMec/Practice-Git)) 54 | * In the folder you've just forked create a folder with the folder name as your GitHub Username, as an addition for us to know who you are, create a `README.md` and add something about yourself and why you'd like to work for FOSS MEC and Open Source and a bit about yourself with your Class and section. And commit this file and give a Pull Request to our official Repository, add the link to the Pull Request in the Google Sheet. 55 | 56 | ##### Time Required: 1 week - 1 month. 57 | 58 | * For completing this part of the task, you should be required to have knowledge of at least one programming language and a HackerRank account. This task should be done simultaneously as you learn a language. 59 | 60 | * There are a set of problems which are given at https://www.hackerrank.com/domains/algorithms/warmup. Take your time and try to learn a language of your own choice by using any book, any online course and solve the set of problems. Remember it's not about who comes first, it is about what all you learn along the way. The questions will start from easy and will become very hard, you can complete as much as you want, but completing more will give you an edge over the competition. Start from `Warm Up` section in HackerRank and move up difficulty. 61 | 62 | * Each time a challenge is solved, update in the Google Sheet in the `Link to your Submissions` section, add the link to your own submission. Remember the sheet is public and everyone can see your submissions. Also take the solved challenge and add it to a file in your own folder and commit and do a Pull Request to our main repo. The sample task can be seen in carrotss folder, who has tried the task. 63 | 64 | #### The Selection will be done when the majority of the people who have completed the tasks or after Excel 2017, which ever comes first, and we'll go through each and every one of your submissions (We'll be giving more weightage to harder algorithmic questions and not the number of questions solved.) for conducting selection. 65 | -------------------------------------------------------------------------------- /RahulR19/readme.md: -------------------------------------------------------------------------------- 1 | Hi 2 | I'm Rahul R of CS1A. 3 | I'm interested in programming and have learned c++,python,a little bit of java and html. 4 | I Would like to learn more,contribute something useful and be an active member of FossMec. 5 | -------------------------------------------------------------------------------- /SadayNarayanan/helloworld.md: -------------------------------------------------------------------------------- 1 | Hello, 2 | I am Saday Narayanan of CS1A and I really hope to be a member of FOSSMEC. 3 | I am a beginner to programming and I am looking forward to learning a lot of things from you guys. 4 | -------------------------------------------------------------------------------- /SadayNarayanan/readme.md: -------------------------------------------------------------------------------- 1 | Hello, 2 | I am Saday Narayanan of CS1A and I really hope to be a member of FOSSMEC. 3 | I am a beginner to programming and I am looking forward to learning a lot of things from you guys. 4 | -------------------------------------------------------------------------------- /Sneha0104/README.md: -------------------------------------------------------------------------------- 1 | hi...I'm sneha saj of cs1a 2 | i chose FOSS because i love to learn new things 3 | especially programms and code ... 4 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/A Very Big Sum.py: -------------------------------------------------------------------------------- 1 | def aVeryBigSum(n, ar): 2 | # Complete this function 3 | s=0 4 | for i in range(n): 5 | s+=ar[i] 6 | return s 7 | 8 | n = int(input().strip()) 9 | ar = list(map(int, input().strip().split(' '))) 10 | result = aVeryBigSum(n, ar) 11 | print(result) 12 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Birthday Cake Candles.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | def birthdayCakeCandles(n, ar): 4 | # Complete this function 5 | #ar denotes the height of the candles 6 | m=max(ar) 7 | c=0 8 | for i in range(n): 9 | if ar[i]==m: c+=1 10 | return c 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = birthdayCakeCandles(n, ar) 15 | print(result) 16 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Compare the Triplets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | # Complete this function 7 | sa=0 8 | sb=0 9 | if (a0b0): 12 | sa+=1 13 | 14 | if (a1b1): 17 | sa+=1 18 | 19 | if (a2b2): 22 | sa+=1 23 | 24 | return [sa,sb] 25 | 26 | a0, a1, a2 = input().strip().split(' ') 27 | a0, a1, a2 = [int(a0), int(a1), int(a2)] 28 | b0, b1, b2 = input().strip().split(' ') 29 | b0, b1, b2 = [int(b0), int(b1), int(b2)] 30 | result = solve(a0, a1, a2, b0, b1, b2) 31 | print (" ".join(map(str, result))) 32 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Diagonal Difference.py: -------------------------------------------------------------------------------- 1 | n = int(input().strip()) 2 | a = [] 3 | for a_i in range(n): 4 | a_t = [int(a_temp) for a_temp in input().strip().split(' ')] 5 | a.append(a_t) 6 | sm=0 7 | so=0 8 | for i in range(n): 9 | for j in range(n): 10 | if i==j: 11 | sm+=a[i][j] 12 | if (i+j==n-1): 13 | so+=a[i][j] 14 | print(abs(sm-so)) 15 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Mini-Max Sum.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | arr = list(map(int, input().strip().split(' '))) 4 | S=[] 5 | for i in range(len(arr)): 6 | s=0 7 | for j in range(len(arr)): 8 | s+=arr[j] 9 | s-=arr[i] 10 | S.append(s) 11 | print(min(S), max(S)) 12 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Simple Array Sum.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | def simpleArraySum(n, ar): 4 | # Complete this function 5 | s=0 6 | for i in range(n): 7 | s+=ar[i] 8 | return s 9 | 10 | n = int(input().strip()) 11 | ar = list(map(int, input().strip().split(' '))) 12 | result = simpleArraySum(n, ar) 13 | print(result) 14 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Solve me First.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | # Hint: Type return a+b below 3 | return a+b 4 | 5 | 6 | num1 = int(input()) 7 | num2 = int(input()) 8 | res = solveMeFirst(num1,num2) 9 | print(res) 10 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/Staircase.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | n = int(input().strip()) 5 | for i in range(n): 6 | print((n-i-1)*' '+(i+1)*'#') 7 | -------------------------------------------------------------------------------- /SrividyaKK/Hackerrank Submissions/kangaroo.py: -------------------------------------------------------------------------------- 1 | def kangaroo(x1, v1, x2, v2): 2 | # Complete this function 3 | if (x1v2): 4 | return ("YES") 5 | else: return ("NO") 6 | 7 | x1, v1, x2, v2 = input().strip().split(' ') 8 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 9 | result = kangaroo(x1, v1, x2, v2) 10 | print(result) 11 | -------------------------------------------------------------------------------- /SrividyaKK/README.md: -------------------------------------------------------------------------------- 1 | 2 | Hey guys!!! I'm Srividya from CSA. Feels exciting to join FOSS and learn git. Eager, Enthusiastic to learn programming and develop my skills. 3 | 4 | # About me: 5 | - I'm a computer enthusiast. 6 | - I love hacking, programming, amd robotics. 7 | - I play the keyboard and the mandolin. 8 | - I love sports, physics, math, music and movies. 9 | 10 | -------------------------------------------------------------------------------- /Wayne297/readme.md: -------------------------------------------------------------------------------- 1 | HEY! 2 | 3 | I'm Akshay Anil of CS-1B. I am a begginer in programming. I have worked with C++ and Mysql and I'm currently learning python. I would like to join FOSSMEC so that I can learn a lot from you guys and also contribute to open source. Looking forward to be an active member of FOSSMEC. 4 | -------------------------------------------------------------------------------- /agzuniverse/a-very-big-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def aVeryBigSum(n, r): 4 | s=0 5 | for i in range(0,n): 6 | s+=r[i] 7 | return s 8 | 9 | n = int(input().strip()) 10 | r = list(map(int, input().strip().split(' '))) 11 | result = aVeryBigSum(n, r) 12 | print(result) 13 | -------------------------------------------------------------------------------- /agzuniverse/apple-and-orange.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | s,t = input().strip().split(' ') 4 | s,t = [int(s),int(t)] 5 | a,b = input().strip().split(' ') 6 | a,b = [int(a),int(b)] 7 | m,n = input().strip().split(' ') 8 | m,n = [int(m),int(n)] 9 | apple = [int(apple_temp) for apple_temp in input().strip().split(' ')] 10 | orange = [int(orange_temp) for orange_temp in input().strip().split(' ')] 11 | u=0 12 | v=0 13 | for i in apple: 14 | if(a+i>=s and a+i<=t): 15 | u+=1 16 | for i in orange: 17 | if(b+i>=s and b+i<=t): 18 | v+=1 19 | print(u) 20 | print(v) 21 | -------------------------------------------------------------------------------- /agzuniverse/between-sets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | from fractions import gcd 4 | 5 | def getTotalX(a, b): 6 | lcm=a[0] 7 | count=0 8 | check=1 9 | for i in a: 10 | lcm=lcm*i/gcd(lcm,i) 11 | o=lcm 12 | while(lcm<=min(b)): 13 | for j in b: 14 | if(j%lcm!=0): 15 | check=0 16 | break 17 | if(check): 18 | count+=1 19 | lcm+=o 20 | check=1 21 | return(count) 22 | 23 | 24 | if __name__ == "__main__": 25 | n, m = input().strip().split(' ') 26 | n, m = [int(n), int(m)] 27 | a = list(map(int, input().strip().split(' '))) 28 | b = list(map(int, input().strip().split(' '))) 29 | total = getTotalX(a, b) 30 | print(total) 31 | 32 | -------------------------------------------------------------------------------- /agzuniverse/birthday-bar.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def solve(n, s, d, m): 4 | c=0 5 | sum=0 6 | for i in range(n-m+1): 7 | for j in range(i,i+m): 8 | sum+=s[j] 9 | if(sum==d): 10 | c+=1 11 | sum=0 12 | return(c) 13 | 14 | n = int(input().strip()) 15 | s = list(map(int, input().strip().split(' '))) 16 | d, m = input().strip().split(' ') 17 | d, m = [int(d), int(m)] 18 | result = solve(n, s, d, m) 19 | print(result) 20 | 21 | -------------------------------------------------------------------------------- /agzuniverse/birthday-cake-candles.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | n=int(input().strip()) 4 | arr=list(map(int,input().strip().split(' '))) 5 | arr=sorted(arr) 6 | l=arr[n-1] 7 | c=0 8 | for i in reversed(arr): 9 | if(i==l): 10 | c+=1 11 | else: 12 | break 13 | print(c) 14 | -------------------------------------------------------------------------------- /agzuniverse/bon-appetit.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def bonAppetit(n, k, b, ar): 6 | sum=0 7 | for i in ar: 8 | sum+=i 9 | sum-=ar[k] 10 | sum=sum/2 11 | if(sum==b): 12 | return("Bon Appetit") 13 | else: 14 | return(int(b-sum)) 15 | 16 | n, k = input().strip().split(' ') 17 | n, k = [int(n), int(k)] 18 | ar = list(map(int, input().strip().split(' '))) 19 | b = int(input().strip()) 20 | result = bonAppetit(n, k, b, ar) 21 | print(result) 22 | 23 | -------------------------------------------------------------------------------- /agzuniverse/breaking-best-and-worst-records.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def getRecord(s): 4 | max_n=s[0] 5 | min_n=s[0] 6 | max_c=0 7 | min_c=0 8 | 9 | for i in s: 10 | if(i>max_n): 11 | max_n=i 12 | max_c+=1 13 | elif(ib0): 4 | r[0]+=1 5 | elif(b0>a0): 6 | r[1]+=1 7 | if(a1>b1): 8 | r[0]+=1 9 | elif(b1>a1): 10 | r[1]+=1 11 | if(a2>b2): 12 | r[0]+=1 13 | elif(b2>a2): 14 | r[1]+=1 15 | return r 16 | 17 | a0, a1, a2 = input().strip().split(' ') 18 | a0, a1, a2 = [int(a0), int(a1), int(a2)] 19 | b0, b1, b2 = input().strip().split(' ') 20 | b0, b1, b2 = [int(b0), int(b1), int(b2)] 21 | result = solve(a0, a1, a2, b0, b1, b2) 22 | print (" ".join(map(str, result))) 23 | 24 | -------------------------------------------------------------------------------- /agzuniverse/day-of-the-programmer.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def solve(year): 4 | if(year<1918): 5 | d=13 6 | if(year%4==0): 7 | d=12 8 | elif(year>1918): 9 | d=13 10 | if(year%400==0 or (year%4==0 and year%100!=0)): 11 | d=12 12 | elif(year==1918): 13 | d=26 14 | return(str(d)+'.09.'+str(year)) 15 | 16 | 17 | year = int(input().strip()) 18 | result = solve(year) 19 | print(result) 20 | 21 | -------------------------------------------------------------------------------- /agzuniverse/diagonal-difference.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | n = int(input().strip()) 4 | a = [] 5 | for a_i in range(n): 6 | a_t = [int(a_temp) for a_temp in input().strip().split(' ')] 7 | a.append(a_t) 8 | m=0 9 | o=0 10 | for d in range(0,n): 11 | m+=a[d][d] 12 | o+=a[d][n-d-1] 13 | print(abs(m-o)) 14 | -------------------------------------------------------------------------------- /agzuniverse/grading.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | def solve(grades): 3 | for i in grades: 4 | if(i<38): 5 | continue 6 | elif(i%5>=3): 7 | grades[grades.index(i)]+=5-(i%5) 8 | return(grades) 9 | n = int(input().strip()) 10 | grades = [] 11 | for i in range(n): 12 | t = int(input().strip()) 13 | grades.append(t) 14 | result = solve(grades) 15 | print ("\n".join(map(str, result))) 16 | -------------------------------------------------------------------------------- /agzuniverse/kangaroo.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def kangaroo(x1, v1, x2, v2): 4 | if((x10): 10 | pos+=1 11 | elif(i<0): 12 | neg+=1 13 | else: 14 | zer+=1 15 | print(pos/n) 16 | print(neg/n) 17 | print(zer/n) 18 | -------------------------------------------------------------------------------- /agzuniverse/readme.md: -------------------------------------------------------------------------------- 1 | # Hi! 2 | I am **Aswin G**, a.k.a "**A G Z**" currently in CS1A. I enjoy programming very much, and want to turn my passion into my profession. 3 | 4 | ## Stuff I like to do 5 | My favorite thing to do is front-end web development. 6 | I've got a couple of apps on the Google Play Store- [The Random App](https://play.google.com/store/apps/details?id=com.agzuniverse.xapp) is probably the only decent one (lol). 7 | I also participated in Google Code-In 2016 (Got a T-shirt and a sticker, thanks Google!) 8 | Other things include Python bots to moderate IRC chat channels and simple games in various languages. 9 | 10 | I also like to play around with Photoshop, edit and create short videos, write stories and play strategy games. 11 | 12 | Currently working on some things with ~~Angular~~ React and ReactNative. 13 | 14 | ## Stuff I want to do 15 | 16 | Arduino and embedded systems programming, make something awesome for RoboWars, and find a bunch of like minded programmers (already done, I guess?) 17 | 18 | ## Why I would like to join FOSSMEC 19 | ~~For the money and the placemenets obviously~~ I want to expland my skills, learn new things and apply my knowledge to code awesome applications that becomes useful to others, while hopefully finding some amazing friends along the way. 20 | -------------------------------------------------------------------------------- /agzuniverse/simple-array-sum.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | def simpleArraySum(n, ar): 4 | sum=0 5 | for i in ar: 6 | sum+=i 7 | return(sum) 8 | # Complete this function 9 | 10 | n = int(input().strip()) 11 | ar = list(map(int, input().strip().split(' '))) 12 | result = simpleArraySum(n, ar) 13 | print(result) 14 | -------------------------------------------------------------------------------- /agzuniverse/solve-me-first.py: -------------------------------------------------------------------------------- 1 | a=int(input()) 2 | b=int(input()) 3 | print(a+b) 4 | -------------------------------------------------------------------------------- /agzuniverse/staircase.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | n=int(input().strip()) 4 | for i in range(n,0,-1): 5 | print((" "*(i-1))+("#"*(n+1-i))) 6 | -------------------------------------------------------------------------------- /agzuniverse/super-reduced-string.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def super_reduced_string(s): 4 | c=1 5 | while(c): 6 | c=0 7 | for i in range(len(s)-1): 8 | if(s[i]==s[i+1]): 9 | s=s[:i]+s[i+2:] 10 | c=1 11 | break 12 | if(s==''): 13 | s='Empty String' 14 | return(s) 15 | 16 | s = input().strip() 17 | result = super_reduced_string(s) 18 | print(result) 19 | -------------------------------------------------------------------------------- /agzuniverse/time-conversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | def timeConversion(s): 4 | m="" 5 | if(s[8:]=="PM" and s[0:2]!="12"): 6 | m=str((int(s[0:2])+12)%24)+s[2:8] 7 | elif(s[8:]=="AM" and s[0:2]=="12"): 8 | m="00"+s[2:8] 9 | else: 10 | m=s[:8] 11 | return m 12 | 13 | s = input().strip() 14 | result = timeConversion(s) 15 | print(result) 16 | -------------------------------------------------------------------------------- /alfvj17/1.solveMeFirst.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int solveMeFirst(int a, int b) { 10 | return a+b; 11 | 12 | } 13 | int main() { 14 | int num1, num2; 15 | int sum; 16 | cin>>num1>>num2; 17 | sum = solveMeFirst(num1,num2); 18 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | int a,b,c,i; 11 | char t[8]; 12 | cin>>t; 13 | a=t[1]-'0'; 14 | b=t[0]-'0'; 15 | c=(b*10+a%10); 16 | if (t[8]=='A') 17 | { 18 | if(c==12) 19 | { 20 | cout<<"00"; 21 | for(i=2;i<=7;i++) 22 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i; 11 | cin>>n; 12 | int A[n]; 13 | for(i=0;i>A[i]; 16 | if(A[i]>=38) 17 | if(A[i]%5>2) 18 | A[i]+=(5-A[i]%5); 19 | } 20 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int a,s,t,b,m,n,i,x=0,y=0; 11 | cin>>s>>t>>a>>b>>m>>n; 12 | int A[m],B[n]; 13 | for(i=0;i>A[i]; 15 | for(i=0;i>B[i]; 17 | for(i=0;i=s)&&((a+A[i])<=t)) 20 | x++; 21 | } 22 | for(i=0;i=s)&&((b+B[i])<=t)) 25 | y++; 26 | } 27 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | long int x1,x2,v1,v2,i,a,b,p=1; 11 | cin>>x1>>v1>>x2>>v2; 12 | a=x1; 13 | b=x2; 14 | for(i=0;i<10000;++i) 15 | { 16 | a+=v1; 17 | b+=v2; 18 | if(a==b) 19 | { 20 | cout<<"YES"; 21 | p=-1; 22 | break; 23 | } 24 | } 25 | if(p==1) 26 | cout<<"NO"; 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /alfvj17/14.betweenTwoSets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,m,i,j,k,max=0,min=101,x=0; 11 | cin>>n>>m; 12 | int A[n],B[m]; 13 | for(i=0;i>A[i]; 16 | if(A[i]>max) 17 | max=A[i]; 18 | } 19 | for(i=0;i>B[i]; 22 | if(B[i] 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i,a=0,b=0,max,min; 11 | cin>>n; 12 | int A[n]; 13 | for(i=0;i>A[i]; 15 | max=A[0]; 16 | min=A[0]; 17 | for(i=1;imax) 20 | { 21 | max=A[i]; 22 | a++; 23 | } 24 | if(A[i] 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,m,d,i,j,s,c=0; 11 | cin>>n; 12 | int A[n],S[n]; 13 | for(i=0;i>A[i]; 15 | cin>>m>>d; 16 | for(i=0;i<=n-d;++i) 17 | { 18 | S[i]=0; 19 | for(j=i;j 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int k,n,i,j,c=0; 11 | cin>>n>>k; 12 | int A[n]; 13 | for(i=0;i>A[i]; 15 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i,l,p=5; 11 | cin>>n; 12 | int A[n],B[5]; 13 | for(i=0;i<5;++i) 14 | B[i]=0; 15 | for(i=0;i>A[i]; 18 | if(A[i]==1) 19 | B[0]++; 20 | else if(A[i]==2) 21 | B[1]++; 22 | else if(A[i]==3) 23 | B[2]++; 24 | else if(A[i]==4) 25 | B[3]++; 26 | else 27 | B[4]++; 28 | } 29 | l=B[4]; 30 | for(i=3;i>=0;--i) 31 | { 32 | if(B[i]>=l) 33 | { 34 | l=B[i]; 35 | p=i+1; 36 | } 37 | } 38 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n; 11 | cin>>n; 12 | if(n==1918) 13 | cout<<"26.09."< 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | 10 | int main() { 11 | int i,n=1; 12 | char c[100000]; 13 | cin>>c; 14 | int l=strlen(c); 15 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int N,i,s=0; 11 | cin>>N; 12 | int A[N]; 13 | for(i=0;i>A[i]; 16 | s+=A[i]; 17 | } 18 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | long int n,k,i,c; 11 | double s; 12 | s=0; 13 | cin>>n>>k; 14 | double A[n]; 15 | for(i=0;i>A[i]; 18 | if(i!=k) 19 | s=s+A[i]/2; 20 | } 21 | cin>>c; 22 | if(s==c) 23 | cout<<"Bon Appetit"; 24 | else 25 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,p=0,i; 11 | cin>>n; 12 | int A[101],count[101]={0}; 13 | for(i=0;i>A[i]; 16 | count[A[i]]++; 17 | } 18 | for(i=0;i<101;i++) 19 | { 20 | if(count[i]!=0) 21 | p+=count[i]/2; 22 | } 23 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,p; 11 | cin>>n>>p; 12 | if(p/2<(n/2-p/2)) 13 | cout<

2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int q,i,j,a,b; 11 | cin>>q; 12 | int A[q][3]; 13 | for(i=0;i>A[i][j]; 16 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int i,n,k,x=0; 11 | cin>>n>>k; 12 | int A[n]; 13 | for(i=0;i>A[i]; 16 | if(A[i]>k) 17 | { 18 | x+=A[i]-k; 19 | k+=A[i]-k; 20 | } 21 | } 22 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int i; 11 | int A[3],a=0; 12 | int B[3],b=0; 13 | for(i=0;i<3;++i) 14 | { 15 | cin>>A[i]; 16 | } 17 | for(i=0;i<3;++i) 18 | { 19 | cin>>B[i]; 20 | if(A[i]>B[i]) 21 | a+=1; 22 | else if(A[i] 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | long long int N,i,t,a,p,n; 11 | cin>>t; 12 | for(i=0;i>N; 15 | n=0; 16 | a=N; 17 | while(a!=0) 18 | { 19 | p=a%10; 20 | if((p!=0)&&(N%p==0)) 21 | n++; 22 | a=a/10; 23 | } 24 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i; 11 | cin>>n; 12 | long int A[n],s=0; 13 | for(i=0;i>A[i]; 16 | s+=A[i]; 17 | } 18 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int i,j,n,s1=0,s2=0; 11 | cin>>n; 12 | int A[n][n]; 13 | for(i=0;i>A[i][j]; 16 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i; 11 | float a=0,b=0,c=0; 12 | cin>>n; 13 | int A[n]; 14 | for(i=0;i>A[i]; 17 | if(A[i]==0) 18 | c++; 19 | else if(A[i]>0) 20 | a++; 21 | else 22 | b++; 23 | } 24 | a=a/n; 25 | b=b/n; 26 | c=c/n; 27 | cout< 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i,j,k,a,b=1,c; 11 | cin>>n; 12 | c=n-1; 13 | for(i=0;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | long int s=0,min,max,s1,s2,i; 11 | long int A[5]; 12 | for(i=0;i<5;++i) 13 | { 14 | cin>>A[i]; 15 | s=s+A[i]; 16 | } 17 | min=A[0]; 18 | max=A[0]; 19 | for(i=1;i<5;++i) 20 | { 21 | if(A[i]>max) 22 | max=A[i]; 23 | else if(A[i] 2 | #include 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | 9 | int main() { 10 | int n,i,max,c=0; 11 | cin>>n; 12 | int A[n]; 13 | for(i=0;i>A[i]; 15 | max=A[0]; 16 | for(i=1;imax) 19 | max=A[i]; 20 | } 21 | for(i=0;i 2 | 3 | 4 |

5 | Hey! 6 |

7 | 8 |

9 | I'm Alfred V Jose of CS 1B. I'm really intrested in exploring and learning new stuff and I love coding. I'm into web and app development and currently enrolled in an online course conducted by iit madras on modern application development. I'm also working on a web app under this course.

10 | Languages worked with: C++, Python, Javascript, HTML and CSS
11 | Database worked with : Mysql
12 |

13 | 14 |
15 | 16 |

17 | Why I Would Like To Join FOSSMEC 18 |

19 | 20 |

21 | I would like to join FOSSMEC so that I can learn new things and make applications out of my knowledge. I can also discuss my ideas and thoughts with others and also make new friends. Looking forward to be an active member of FOSSMEC and contribute to open source.
22 |

23 | 24 |
25 | 26 |

27 | Contact Me 28 |

29 | 30 |

31 | Telegram - https://t.me/alf_vj17
32 | Github - https://github.com/alfvj17 33 |

34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /arjunlal99/README.md: -------------------------------------------------------------------------------- 1 | I am Arjunlal M. A. of CS1B. Id love to join FOSSMEC and learn more about it through practise. Im familiar with Python and a bit C++, Java and SQL. 2 | Id love to be part and contribute to FOSSMEC and opensource. 3 | -------------------------------------------------------------------------------- /aswin1999/README.md: -------------------------------------------------------------------------------- 1 | I am Aswin.M.Prabhu from CS1A. Coding is my passion. I would like to actively contribute to FOSS if selected. 2 | -------------------------------------------------------------------------------- /carrotss/README.md: -------------------------------------------------------------------------------- 1 | ### Carrotss 2 | 3 | I'm John Doe from CS-Doe A. I'm passionate about Python and please give me entry to FOSS MEC. -------------------------------------------------------------------------------- /carrotss/simple-array-sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | 6 | n = int(input().strip()) 7 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 8 | print(sum(arr)) 9 | -------------------------------------------------------------------------------- /carrotss/solve-me-first.py: -------------------------------------------------------------------------------- 1 | def solveMeFirst(a,b): 2 | # Hint: Type return a+b below 3 | return a+b 4 | 5 | num1 = int(input()) 6 | num2 = int(input()) 7 | res = solveMeFirst(num1,num2) 8 | print(res) 9 | -------------------------------------------------------------------------------- /firebreath1001/readme.md: -------------------------------------------------------------------------------- 1 | hello world!! I am Jery James jacob arangath (you can call me Jerry). 2 | I wish to join FOSSMEC to venture into the open-source world and contribute to my fullest potential, i know C++, a bit of html,and python 3 | I am deeply interested in learning new languages. 4 | -------------------------------------------------------------------------------- /hari-xix/README.md: -------------------------------------------------------------------------------- 1 | Hi! 2 | I'm Harinarayanan Shaji from CS1A and I code in C++ and Python and I believe I'd be an asset to FOSS. 3 | -------------------------------------------------------------------------------- /hello-world.md: -------------------------------------------------------------------------------- 1 | Hello there, 2 | My name is Joseph(Joe).I'm studying in CS1B. I am really interested in 3 | becoming a developer and I am ready to work for that, and becoming a part of FOSS MEC will be huge step.Working with experienced seniors and classmates and getting thier views on the subject will surely change my perspectives and hence will enable me to contribute more to the Open Source Community. 4 | I am currently learning Python and HTML,CSS,Java-Script. I have studied Java for 3 years. Hope to see you guys.Bye :) 5 | 6 | -------------------------------------------------------------------------------- /j-winfield/readme.md: -------------------------------------------------------------------------------- 1 | Im Befin Babu of CS1B.Im interested in coding.Looking forward to be 2 | an active member of FOSS. 3 | -------------------------------------------------------------------------------- /kss682/a vey big sum.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def aVeryBigSum(n, ar): 6 | # Complete this function 7 | S=0 8 | for i in range(0,n): 9 | S=S+ar[i] 10 | return S 11 | 12 | n = int(input().strip()) 13 | ar = list(map(int, input().strip().split(' '))) 14 | result = aVeryBigSum(n, ar) 15 | print(result) 16 | -------------------------------------------------------------------------------- /kss682/compare the triplets.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import sys 4 | 5 | def solve(a0, a1, a2, b0, b1, b2): 6 | # Complete this function 7 | A,B=0,0 8 | if(a0>b0): 9 | A+=1 10 | elif(b0>a0): 11 | B+=1 12 | if(a1>b1): 13 | A+=1 14 | elif(a1b2): 17 | A+=1 18 | elif(a2v1 or v1>v2): 7 | if(((x2-x1)%(v1-v2)==0 and v1-v2>0 and x2>x1) or ((x1-x2)%(v2-v1)==0 and v2>v1 and x1>x2)) : 8 | return "YES" 9 | else: 10 | return "NO" 11 | else: 12 | return "NO" 13 | 14 | x1, v1, x2, v2 = input().strip().split(' ') 15 | x1, v1, x2, v2 = [int(x1), int(v1), int(x2), int(v2)] 16 | result = kangaroo(x1, v1, x2, v2) 17 | print(result) 18 | -------------------------------------------------------------------------------- /kss682/plusminus.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | 4 | 5 | n = int(input().strip()) 6 | arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] 7 | A,B,C=[0.0,0.0,0.0] 8 | for i in range(0,n): 9 | if(arr[i]>0): 10 | A+=1 11 | elif(arr[i]<0): 12 | B+=1 13 | else: 14 | C+=1 15 | print(A/n) 16 | print(B/n) 17 | print(C/n) 18 | 19 | -------------------------------------------------------------------------------- /kss682/readme.md: -------------------------------------------------------------------------------- 1 | hi Iam Srinidhi Krishna of CSb.I am interested in programming and algorithms . 2 | Looking forward to be a part of Foss mec. 3 | -------------------------------------------------------------------------------- /kss682/simple_array_sum.py: -------------------------------------------------------------------------------- 1 | import array 2 | N=int(input("")) 3 | S=0 4 | list=array.array('i',[]) 5 | list=[int(i) for i in input().split()] 6 | for i in range(N): 7 | S=S+list[i] 8 | print(S) 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /kss682/staircase.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | 4 | 5 | n = int(input().strip()) 6 | for i in range(1,n+1): 7 | for j in range(1,n+1): 8 | if(i+j>n): 9 | print('#',end='') 10 | else: 11 | print('\t',end='') 12 | print('\n') 13 | -------------------------------------------------------------------------------- /mennyt11/readme.md: -------------------------------------------------------------------------------- 1 | hi, 2 | Menny here, i'm from EC1A batch , i love coding in C++ , can do it all day. I like to be a part of open source initiative. Looking forward to become an active member of FossMec. 3 | -------------------------------------------------------------------------------- /my first commit: -------------------------------------------------------------------------------- 1 | Hi there! My name is Nevin Sunny from CS1B.I am very much interested in contributing to OpenSource and also believe that FOSSMEC would be the best platform for developing the skills required. 2 | I am currently learning Python. 3 | -------------------------------------------------------------------------------- /pkn2000/README.md: -------------------------------------------------------------------------------- 1 | Hi I am Parvati K Nair of CS1A. What I can say about myself is that I am a hardworker and a sincere person. 2 | I would like to be part of FossMEC as I think it will give me lots of opportunities to explore the wide field 3 | of Computer Science. 4 | -------------------------------------------------------------------------------- /shwethabm/readme.md: -------------------------------------------------------------------------------- 1 | 2 | Hello!I am Shwetha B Menon from CS1-A.I am very much keen on joinig FOSS MEC as i am interested in programming and would ike to learn more on it. 3 | 4 | -------------------------------------------------------------------------------- /steevjames/readme.md: -------------------------------------------------------------------------------- 1 | I am Steev James, interested in development of Open source softwares. I am currently studying in CS1A. I wish to be a member of FOSSMEC. :) 2 | -------------------------------------------------------------------------------- /vidyasreekumar/readme.md: -------------------------------------------------------------------------------- 1 | Hi i am Vidya Sreekumar, currently studying in CS1A. i have done programing in c++ and im excited to learn python. i look forward to contribute and be an active member of FOSS MEC. 2 | --------------------------------------------------------------------------------