├── 2019 ├── Aditk23 │ └── README.md ├── AkshitAggarwal │ └── README.md ├── AnubhavJangid │ └── README.md ├── ArgonArnav │ └── README.md ├── DeadVampire │ └── README.md ├── Dfuck │ └── README.md ├── Frosty-99 │ └── README.md ├── GeekyKarthik │ └── README.md ├── HeyAayush │ └── README.md ├── Jatinx3 │ └── README.md ├── KaushikJais │ └── README.md ├── Maheima │ └── README.md ├── Nimish19 │ └── README.md ├── Nitanshu │ └── README.md ├── Pradhvan │ └── README.md ├── Prakhar2209 │ └── README.md ├── Pratul1997 │ └── README.md ├── Prayas │ └── readme.md ├── Priya-sharma123 │ └── README.md ├── README.md ├── RichieRij │ └── README.md ├── SahilKharya │ └── README.md ├── Sakshamtaneja21 │ ├── README.md │ └── day 1 ├── Sid-Sun │ └── README.md ├── Sshashank18 │ └── README.md ├── Sumedha-shrivastava │ └── README.md ├── Taliya19 │ └── README.md ├── Thtsuman │ └── README.md ├── Tushargoyal02 │ └── README.md ├── VarshitAgarwal │ ├── Day1_ML_LR │ └── README.md ├── Vibs00 │ └── README.md ├── Walter-Escobar │ └── README.md ├── aditya98ak │ └── README.md ├── aishwarya11mar │ └── README.md ├── akkimah │ └── README.md ├── akshaybengani │ └── README.md ├── allenpbiju │ └── README.md ├── arishta │ └── README.md ├── arnabsinha99 │ └── README.md ├── ayushisaxena22050 │ └── README.md ├── ayushjain1144 │ └── README.md ├── ayushs │ └── README.md ├── bharatpurohit97 │ └── README.md ├── carotkut94 │ ├── Day 10 │ │ └── StringTranslation.py │ ├── Day 11 │ │ └── TwoSum.py │ ├── Day 12 │ │ └── BST.py │ ├── Day 13 │ │ ├── UniqueMail.py │ │ └── UniqueMorse.py │ ├── Day 14 │ │ └── Palindrome.py │ ├── Day 15 │ │ └── Cipher.py │ ├── Day 16 │ │ └── PalindromSubstring.py │ ├── Day 17 │ │ └── NthFibonacci.py │ ├── Day 18 │ │ └── LevenshteinDistance.py │ ├── Day 19 │ │ ├── BinarySearch.py │ │ └── ShiftedBinarySearch.py │ ├── Day 2 │ │ └── Unique.py │ ├── Day 20 │ │ └── TripletSum.py │ ├── Day 21 │ │ └── SmalletsDifference.py │ ├── Day 22 │ │ └── HeapSort.py │ ├── Day 23 │ │ └── Permutation.py │ ├── Day 24 │ │ └── BinaryNumbers.py │ ├── Day 25 │ │ └── AbsoluteMinimum.py │ ├── Day 26 │ │ └── KadaneAlgorithm.py │ ├── Day 27 │ │ └── KMPAlgo.py │ ├── Day 28 │ │ └── Largest3.py │ ├── Day 29 │ │ └── FourNumberSum.py │ ├── Day 3 │ │ └── EvenSum.py │ ├── Day 30 │ │ └── MinJumps.py │ ├── Day 31 │ │ └── LargestRange.py │ ├── Day 32 │ │ └── MaximumDifference.py │ ├── Day 33 │ │ └── AddTwoNumbers.py │ ├── Day 34 │ │ └── JewelsAndStones.py │ ├── Day 4 │ │ └── RotateArray.py │ ├── Day 5 │ │ └── HourGlass.py │ ├── Day 6 │ │ └── ClassesAndObjects.py │ ├── Day 7 │ │ └── MergeSort.py │ ├── Day 8 │ │ └── QuickSort.py │ ├── Day 9 │ │ └── DataDumper.py │ ├── Day1 │ │ └── 3or5.py │ └── README.md ├── chetan915719 │ └── README.md ├── deathwarden150 │ └── README.md ├── deepeshm41 │ └── README.md ├── dhruv-gupta14 │ └── README.md ├── divyaparwani │ └── README.md ├── gargvaibhav64 │ └── README.md ├── gauravrock │ ├── README.md │ ├── Screenshot 2019-01-06 at 11.43.57 PM.png │ ├── code datacamp │ │ ├── day9_basicpandas_code.py │ │ └── func_in_func.py │ ├── day9_code │ │ └── project1 │ │ │ ├── datasets │ │ │ ├── global_temperature.csv │ │ │ ├── project_image.png │ │ │ └── run_code_cell_image.png │ │ │ └── notebook.ipynb │ └── read_books │ │ ├── Elementary Statistics A Step By Step Approach 9th ed Bluman.pdf │ │ ├── Introduction_to_Probability_and_Statisti.pdf.pdf │ │ └── thinkstats2.pdf ├── gdivya17 │ └── README.md ├── gopalsharma05 │ └── README.md ├── gupta-here │ └── README.md ├── hiteshsubnani0128 │ ├── Multiples of 3 and 5 │ └── README.md ├── hrprt96 │ └── README.md ├── jains8844 │ └── README.md ├── jayeshchoubisa │ └── README.md ├── karangurtu │ └── README.md ├── kmalik31 │ └── README.md ├── luckyster895 │ └── README.md ├── may12day │ └── README.md ├── mithilesh-parmar │ └── README.md ├── moulikcipherX │ └── README.md ├── mr-sharmaji │ └── README.md ├── n0obs73r │ └── README.md ├── nikhiljain │ └── Read Me.md ├── piyushagarwal08 │ ├── README.md │ └── contains_duplicate.py ├── prashant0598 │ └── README.md ├── prayas26 │ └── README.md ├── premanshupareek │ └── README.md ├── ravigupta │ └── README.md ├── rishabhkalakoti │ └── README.md ├── ritik619 │ └── README.md ├── ritikmahesh │ └── README.md ├── rustagishubhi │ └── README.md ├── sahushivam713 │ └── README.md ├── sakshipareek │ └── README.md ├── sanjeevbrin │ └── README.md ├── shivank98 │ ├── LeetCodeSolution │ │ ├── LongestCommanPrefix.py │ │ └── RemoveDuplicatesfromSorted.py │ └── README.md ├── soumilk │ ├── 1.Two Sum.md │ ├── 217.Contains Duplicate.md │ ├── 219.Contains Duplicate II.md │ ├── 7.Reverse Integer.md │ ├── Explanation of fast exponentiation.md │ ├── Fast Exponentiation.py │ ├── February Cook-Off 2019 │ │ ├── Buying New Tablet.py │ │ ├── Chef and Party.py │ │ ├── Max Range Queries.py │ │ └── Questions link.md │ ├── HackerEarth Engineering Intern Challenge │ │ ├── Q-1 Path in Trees │ │ │ ├── 1path in trees.jpeg │ │ │ ├── path in trees continued.jpeg │ │ │ └── solution Trees.py │ │ ├── Q-2 Array Construction │ │ │ ├── 1array construction.jpeg │ │ │ ├── array construction continued.jpeg │ │ │ └── prefix sum.py │ │ └── Q-3 Similarity of Strings │ │ │ ├── 1similarity of strings .png │ │ │ ├── similariy os strings continued.png │ │ │ └── strings.py │ ├── Hashing with collision.py │ ├── Internship Screening Test │ │ ├── Airavath-1.cpp │ │ ├── Airavath-2.cpp │ │ ├── Airavath-3.cpp │ │ ├── Algorithms.txt │ │ ├── ans-4.txt │ │ ├── test part-1.png │ │ ├── test part-2.png │ │ ├── test part-3.png │ │ ├── test part-4.png │ │ └── test part-5.png │ ├── Internship screening test-2 │ │ ├── Approach.txt │ │ ├── Explanation of code.txt │ │ ├── Question.txt │ │ ├── RTU1.cpp │ │ ├── a.out │ │ └── sample output │ ├── NYU meetup.md │ ├── README.md │ ├── Sorting algorithm O(n^2).cpp │ ├── Testing in python │ │ ├── Calculations.py │ │ ├── __pycache__ │ │ │ └── Calculations.cpython-36.pyc │ │ └── test_calc.py │ ├── deque.py │ └── python IO │ │ ├── explained read.py │ │ ├── io_in_python.py │ │ └── test.txt ├── spandey232 │ └── README.md ├── tanaymehta28 │ ├── Day 01 │ │ └── matix-generation-and-operations.py │ ├── Day 02 │ │ └── lr.py │ ├── Day 03 │ │ ├── .ignore │ │ └── Linear Regression Tensorflow .ipynb │ ├── Day 04 │ │ ├── index.html │ │ └── main.css │ ├── Day 05 │ │ └── Python Ray Tracing.ipynb │ ├── Day 06 │ │ └── logistic_regression.py │ ├── Day 07 │ │ └── tf mnist.py │ ├── Day 08 │ │ └── kernel_main.asm │ ├── Day 09 │ │ ├── core.js │ │ ├── index.html │ │ └── loadData.js │ ├── Day 10 │ │ ├── Admission_Predict.csv │ │ └── linear-regression-normal.py │ ├── Day 11 │ │ └── linear_regression_numpy.py │ ├── Day 12 │ │ └── noFile.md │ └── README.md ├── tarunagarwal99 │ └── README.md ├── tash149 │ ├── README.md │ └── open1.py ├── thameemk612 │ └── README.md └── v4vishalchauhan │ └── README.md ├── 2020 ├── README.md └── arjoonn │ ├── d1.py │ ├── d2.py │ ├── d3.py │ ├── d4.py │ └── d5.py ├── .github ├── CODEOWNERS └── PULL_REQUEST_TEMPLATE.MD ├── .gitignore ├── README.md └── update_readme.py /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @prashant0598 @Pratul1997 @Shivank98 @moulikcipherX 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.MD: -------------------------------------------------------------------------------- 1 | 2 | **Checklist (Mandatory)** 3 | 4 | - [ ] Link to question 5 | - [ ] Code 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | __pycache__/ 3 | -------------------------------------------------------------------------------- /2019/Aditk23/README.md: -------------------------------------------------------------------------------- 1 | # Adit Khandelwal 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/AkshitAggarwal/README.md: -------------------------------------------------------------------------------- 1 | # Akshit Aggarwal 2 | 3 | #Introduction 4 | 5 | I'm Akshit Aggarwal, 19. I'm an Information Technology Freshman year student from New Delhi. The main reason for me, just like most people to join this initiative is get into the continuity of Programming. I'm not yet sure what all I'll be doing each and every day but I'm looking forward to learning lots of new things. Currently I'm doing a course of EdX named CS50x offered by Harvard University, it's a wonderful course, although it's introductory it can get very challenging at times, but if you bear through it you will learn a lot of thing as I'm right now. 6 | 7 | Other than CS50 I'm also doing problems at Project Euler, it's all about solving Mathematical problems using Programming algorithm, their website only takes input as a Mathematical number which is the answer to the problem that you're solving. 8 | 9 | ### Day 1 10 | 11 | 12 | ### Day 2 13 | 14 | 15 | ### Day 3 16 | -------------------------------------------------------------------------------- /2019/AnubhavJangid/README.md: -------------------------------------------------------------------------------- 1 | # Anubhav Jangid 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/ArgonArnav/README.md: -------------------------------------------------------------------------------- 1 | ARNAV ANAND 2 | * Intro: Hi I am Arnav from New Delhi and I have Just started #100DaysOfCode with Android Development in Java and Kotlin. 3 | * Day 1: So Day 1 concluded with not much content, mainly covered and revised the previously learned basics of Android programming which consisted of Mastering layouts ,text-views ,buttons ,image-views and toast messages (along with a demo app illustrating the the above basics). 4 | * Day 2: On the Day 2 of the #100DaysOfCode in Android Development ,I learnt the concepts related to Git-Android which involved the understanding and mastering of Command Line tool ,version control ,git parallel development and integrating git into Android Studio. 5 | * Day 3: On the Day 3 of #100DaysOfCode in Android Development I covered the basic of Java programming and understood the concepts related to variables ,also I made a "Hi Android Developers" app on my mobile phone demonstrating the concepts learnt. 6 | * Day 4: Day 4 of #100DaysOfCode in Android Development concluded with the end of Intermediate java programming which includes Arrays, Control Statements and Loops. 7 | 8 | AFTER A SHORT BREAK DUE TO SOME UNAVOIDABLE WORK 9 | 10 | * Day 5: Day 5 resumed to continue with Java Programming and included understanding the concepts of OOPS (Object Oriented Programming Systems). 11 | * Day 6: On the Day 6 of #100DaysOfCode I nearly completed Java programming and will start implementing it's concepts in the form apps. 12 | -------------------------------------------------------------------------------- /2019/DeadVampire/README.md: -------------------------------------------------------------------------------- 1 | # Ravi Kumawat 2 | I have no special talent, I'm just passionately curious. I believe in this. I basically stepped into this field when I used to compile custom forks of AOSP but gradually, curiosity got the better of me and I dived right into C/C++.C++ will always be my preferred language and the one I am most comfortable to work with but no surprise I'm here right now because in this field, you can't limit yourself to your comfort zone and personal preferences, you gotta explore new things and move forward. And so I started learning python, mainly for Data Science and AI applications, and it's going great as of now. 3 | 4 | I'm a 1st year B.Tech CSE student. I'm currently following Andrew Ng's ML course on coursera and improving my grasp on Data Structures and Algorithms. 5 | 6 | As my new year's resolution, I commit to take **#100DaysOfCode** challenge as a serious check in for doing something productive everyday even if it's for at least an hour, and keep strong dedication towards it. 7 | 8 | ## Happy Coding! 9 | 10 | ### Day 1 11 | Solved problems related to Binary Trees and Linked Lists on leetcode. 12 | Can be checked out [here](https://leetcode.com/ravi4kumawat). 13 | 14 | Gradually progressing in ML course and Django docs. Learnt about Uni and Multi-variate linear regression and gradient descent. 15 | 16 | ### Day 2 17 | The same as usual daily routine of Problem Solving on leetcode and hackerrank. 18 | 19 | Progress in ML - Octave/Matlab setup and basics, Intro to R and polynomial regression. 20 | 21 | Django and backend basics. 22 | 23 | ### Day 3 24 | Learnt and solved more about data structures and algorithms. 25 | 26 | Examined and tried replicating standard libraries/modules on various functions and structures. 27 | 28 | Progress in ML - Feature scaling, Learning Rate, polynomial regression basics. 29 | 30 | ### Day 4 31 | Progress in ML - MATLAB/OCTAVE programming, R, solved some examples on multi variate linear regression. 32 | 33 | Will push all my work since day 1 someday later as Internet connection is not stable here. 34 | 35 | ### Day 5 36 | Progress in ML - Polynomial regression practice examples, logistic regression. 37 | 38 | Solved some more problems on leetcode on data structures and oop. 39 | 40 | ### Day 6 41 | Progress in ML - None, didn't get much time today 42 | 43 | Solved some more problems on leetcode (mainly binary trees) and hackerrank, gradually attempting more difficult problems. 44 | 45 | ### Day 7 46 | Progress in ML - Reimplemented Andrew Ng's linear regression exercise in Python and R. 47 | 48 | *Let's Start Django* from today. 49 | 50 | ### Day 8 51 | Progress in ML - Logistic regression examples and exercise. 52 | Django - Queries and Database Layer. 53 | Same daily routine of problem solving on leetcode and hackerrank. 54 | 55 | ### Day 9 56 | Progress in ML - More on Logistic regression, implementing from scratch. 57 | 58 | Django - Queries and forms. 59 | 60 | And some time spent on leetcode. 61 | 62 | ### Day 10 63 | Progrss In ML - Normal equation and more on Logistic Regression. 64 | 65 | Django - Forms and web scraping. 66 | 67 | ### Day 11 68 | Progress in ML - Classification and hypothesis representation. 69 | 70 | Django - Views and URLs. 71 | 72 | Solved and implemented some more questions from leetcode and hackerrank. 73 | 74 | ### Day 12 75 | Progress in ML - Hypothesis, Decision boundary and optimizing the cost 76 | function. 77 | 78 | Today was a tiring day, so nothing much else. 79 | 80 | ### Day 13 81 | Progress in ML - Learnt more about binary classification, decision boundaries. 82 | 83 | ### Day 14 84 | Progress in ML - Implemented Logistic regression and binary classification in python. 85 | 86 | ### Day 15 87 | Progress in ML - Optimization and multi class classification. 88 | 89 | ### Day 16 90 | Progress in ML - Advance Optimization, vectorization implemented with numpy and scikit learn. 91 | 92 | ### Day 17 93 | Progress in ML - Regularized regression and some basic intro to TensorFlow. 94 | 95 | ### Day 18 96 | Progress in ML - Neural networks with TensorFlow, multi class classification. 97 | 98 | ### Day 19 99 | Progress in ML - Neural Networks and propagation, non linear hypothesis. 100 | 101 | ### Day 20 102 | Progress in ML - Still working on multi class classification and neural networks. 103 | 104 | ### Day 21 105 | Progress in ML - Digging deeper into TensorFlow and implementing some of its functions manually to have a better understanding. 106 | 107 | ### Day 22 108 | Progress in ML - Overfitting, regularization, neural networks and model representation and some hands on with pytorch! 109 | 110 | Getting familiar with advance concepts in C/C++ - Memory management, low level hardware programming (drivers for basic io devices). 111 | 112 | Yeah, I know took I took a long break due to some unavoidable work(mostly including me being a sloth)! :v 113 | I will try to be as much regular as possible from now on. 114 | 115 | ### Day 23 116 | ML Progress - Neural networks, backpropagation algos and its implementation. 117 | 118 | ### Day 24 119 | ML Progress - Model selection, testing and validation. 120 | 121 | ### Day 25 122 | ML Progress - Bias and variance, learning methods and curves and 123 | some more in-depth in PyTorch. 124 | 125 | ### Day 26 126 | ML Progress - Training a neural net and error analysis. 127 | 128 | ### Day 27 129 | ML Progress - SVM, margin classification. 130 | 131 | ### Day 28 132 | ML Progress - Using SVM, implementing in python from basic and using 133 | it from pyTorch. 134 | 135 | ### Day 29 136 | ML Progress - Learned about SVR and SVM and implemented Random Forest Classification algo on a tourism spots dataset. 137 | 138 | ### Day 30 139 | ML Progress - Hierarchical clustering, XGBoost and Upper confidence bound. 140 | 141 | ### Day 31 142 | ML Progress - Analysis(Component and Discriminant), Kernel PCA and 143 | Sampling. 144 | -------------------------------------------------------------------------------- /2019/Dfuck/README.md: -------------------------------------------------------------------------------- 1 | # Deepak Choudhary 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Frosty-99/README.md: -------------------------------------------------------------------------------- 1 | # Anuj Sharma 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/GeekyKarthik/README.md: -------------------------------------------------------------------------------- 1 | # Karthik 2 | 3 | This is karthikeyan from chennai. Currently learning web development and solving some beginner programming problems. 4 | ### Day 1 5 | 6 | Learned HTML and CSS attributes and tags. 7 | 8 | ### Day 2 9 | 10 | 11 | ### Day 3 12 | -------------------------------------------------------------------------------- /2019/HeyAayush/README.md: -------------------------------------------------------------------------------- 1 | # Aayush Bhargava 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Jatinx3/README.md: -------------------------------------------------------------------------------- 1 | # Jatin Assudani 2 | 2nd year Btech CSE Student ! 3 | 4 | ### Day 1 [1/01/19] 5 | 1. Understanding the concept of VueJS 6 | 7 | ### Day 2 8 | 9 | 10 | ### Day 3 11 | -------------------------------------------------------------------------------- /2019/KaushikJais/README.md: -------------------------------------------------------------------------------- 1 | # Kaushik Jaiswal 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Maheima/README.md: -------------------------------------------------------------------------------- 1 | # Mahima Khandelwal 2 | I am a budding programmer and have an interest in the field of Machine Learning. I currently know languages like C (Intermediate level), c++ (Begineer level), Python (Intermediate level).I've also made some mini projects in Python like TIC-TAC-TOE, clock and a library management database system. I look forward to completing my online ML courses and enhancing my programming skills (by practicing on sites like hackerrank, leetcode etc) altogether in these 100 days of code. I also look forward to work on some projects in the field of same. 3 | 4 | ### Day 1 5 | 6 | 7 | ### Day 2 8 | 9 | 10 | ### Day 3 11 | -------------------------------------------------------------------------------- /2019/Nimish19/README.md: -------------------------------------------------------------------------------- 1 | *Intro 2 | * Day-1 3 | * Day-2 4 | * Day-3 5 | -------------------------------------------------------------------------------- /2019/Nitanshu/README.md: -------------------------------------------------------------------------------- 1 | # Nitanshu 2 | 3 | Hi! I love to spend time with my computer. 4 | 5 | ### Day 1 ( 01-01-2019 ) 6 | 7 | - Solved 2 problems from SPOJ. 8 | 9 | ### Day 2 ( 02-01-2019 ) 10 | 11 | - Solved 2 problems from SPOJ. (ACODE & EIGHTS) 12 | 13 | ### Day 3 ( 03-01-2019 ) 14 | 15 | - Solved 2 problems from SPOJ. (PALIN & HANGOVER) 16 | 17 | ### Day 4 ( 04-01-2019 ) 18 | 19 | - Solved 2 problem from SPOJ. (AGGRCOW & WILLITST) 20 | 21 | ### Day 5 ( 05-01-2019 ) 22 | 23 | - Spent all the time trying to understand binary search article by topcoder. Still trying. 24 | 25 | ### Day 6 ( 06-01-2019 ) 26 | 27 | - Solved 1 problem from codechef jan long contest. Slacked off. 28 | 29 | ### Day 7 ( 07-01-2019 ) 30 | 31 | - Solved AutoLoan form TopCoder. In b/w solving 2 problems from codechef jan long contest. 32 | 33 | ### Day 8 ( 08-01-2019 ) 34 | 35 | - Was able to solve 3 problems in codechef long contest. 1 full and 2 partial. 36 | 37 | ### Day 9 ( 09-01-2019 ) 38 | 39 | - Solved SortEstimate from TopCoder and in b/w ABCDEF from SPOJ. 40 | 41 | ### Day 10 ( 10-01-2019 ) 42 | 43 | - Head banging over codechef long contest problems. 44 | -------------------------------------------------------------------------------- /2019/Pradhvan/README.md: -------------------------------------------------------------------------------- 1 | # Pradhvan Bisht 2 | 3 | I am a Python geek! and a novice Djangonaut, I love playing around with web technologies and have an interest in backend development. You can read more about me at [pradhvanbisht.in](https://pradhvanbisht.in/). 4 | 5 | My 100 DaysofCode journey is sub-divided into weeks(sprints) where each day I will record my progress with the minimum time an hour and update the estimated and at the end of the week will calculate the estimated work done with the total work done. For now, the estimated time is 7 hrs per week. 6 | 7 | I mainly plan to finish the exercises of [Data Structures and Algorithms in Python](https://www.amazon.in/Structures-Algorithms-Python-Michael-Goodrich/dp/812656217X/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=&sr=) and for the gap which I spend on reading chapters to reach to those exercises I would be either working on the questions from [Elements of Programming Interviews in Python: The Insiders' Guide](https://www.amazon.in/Elements-Programming-Interviews-Python-Insiders/dp/1537713949/ref=sr_1_1?s=books&ie=UTF8&qid=1546330150&sr=1-1&keywords=elements+of+programming+interviews+in+python) or submitting patches to my half cooked side projects which reside at [PyRandon](https://github.com/Pradhvan/PyRandom). 8 | 9 | ## Day 1 - Day 7 10 | 11 | #### Topic to Cover in the first week sprint:- 12 | 13 | 1. **Exercises 2.7** : P-2.33 - P-2.39 [ETA 4 Days] 14 | 15 | 2. **Arrays** [ETA 3 Days] 16 | 17 | 18 | #### Bonus:- 19 | 20 | * Get inital setup done using trees to calculate distance for Spell Checker with The Levenshtein Algorithm. 21 | 22 | 23 | | Day | Topic | Estimated Time| Actual Time | Clocked Timings | 24 | | ---------- | :-------------:| -----:| -----:| --------:| 25 | | 1 |OOPS - P.33-P.35 | 1Hr |1Hr 10min |7:00 PM -8:10 PM | 26 | | 2 | - | 1Hr | - | - | 27 | | 3 | - | 1Hr | - | - | 28 | | 4 |OOPS - P.36 | 1Hr | 2hr |7:00 PM -8:00PM | 29 | | 5 | | | | | 30 | | 6 | | | | | 31 | | 7 | | | | | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /2019/Prakhar2209/README.md: -------------------------------------------------------------------------------- 1 | # Prakhar Saxena 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Pratul1997/README.md: -------------------------------------------------------------------------------- 1 | # Pratul Kumar 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Prayas/readme.md: -------------------------------------------------------------------------------- 1 | # Prayas Mittal 2 | 3 | **Introduction** 4 | *Python programmer and a budding entrepreneur, currently working for a startup Selekt.in in Mumbai, Maharashtra.* -------------------------------------------------------------------------------- /2019/Priya-sharma123/README.md: -------------------------------------------------------------------------------- 1 | # Priyanka Sharma 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/README.md: -------------------------------------------------------------------------------- 1 | # 100DaysOfCode with PyJaipur 2 | 3 | **100 Days of Code is a challenge/community, where you publicly commit to code for 1 hour for the next 100 days.** 4 | 5 | ## Rules: 6 | * Code minimum an hour every day for the next 100 days. 7 | * Tweet your progress every day with the #100DaysOfCode hashtag.( if not twitting daily you need to mention progress in this repo.) 8 | 9 | ## Benefits: 10 | * Coding will become a daily habit for you. 11 | * Every day that you consistently code, you’ll build momentum. That momentum will make it easier for you to learn more advanced topics. 12 | * The projects that you’ll build will be small in scope, so by the time you finish, you’ll have completed several of them — and gained a wide range of experience. 13 | * Your GitHub profile will look extremely active. And yes, hiring managers and recruiters do look at these. 14 | * You’ll greatly diminish your fear of starting a new coding project. It will become a natural, ordinary thing to do. 15 | * You’ll have a good reason to stop procrastinating and start coding every day. 16 | 17 | ## What from PyJaipur Community: 18 | 19 | * Some Swags. 20 | * Possible internship opportunity. 21 | * **Assured Certificates from PyJaipur**. 22 | * Listing on our Github repo where you can log and update your progress. 23 | * A community where you can always discuss your troubles seek mentorships etc. 24 | 25 | ## Rules: 26 | - [ ] Join the [Telegram Group](https://web.telegram.org/#/im?p=@pyjaipur) 27 | - [ ] Make a commitment on Twitter on 1st January with #100DaysOfCode and #PyJaipur or #PyJaipurIsAwesome in order to get elligble for rewards from PyJ. 28 | - [ ] **In this repo find the folders with the Username, you can update README.md in your folder for daily logs start with your Introduction.** 29 | 30 | ## Project Ideas: 31 | 32 | ### Leetcode 33 | LeetCode is the best platform to help you enhance your skills, expand your knowledge and prepare for technical interviews. 34 | 35 | ### Project Euler 36 | 37 | Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems. 38 | 39 | Link: [Main Website](https://projecteuler.net) , [Hackerrank](https://www.hackerrank.com/contests/projecteuler/challenges) 40 | 41 | *If you still have doubt about anything either post it in issues, or at out [telegram group](https://web.telegram.org/#/im?p=@pyjaipur)* 42 | -------------------------------------------------------------------------------- /2019/RichieRij/README.md: -------------------------------------------------------------------------------- 1 | # Riju Chakraborty 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/SahilKharya/README.md: -------------------------------------------------------------------------------- 1 | # Sahil Kharya 2 | 3 | I am Sahil Kharya currently in 3rd year doing my B.tech in Computer Science. 4 | 5 | 6 | ### Day 1 7 | Started improving my Python language skills. 8 | 9 | ### Day 2 10 | 11 | 12 | ### Day 3 13 | -------------------------------------------------------------------------------- /2019/Sakshamtaneja21/README.md: -------------------------------------------------------------------------------- 1 | # saksham Taneja 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Sakshamtaneja21/day 1: -------------------------------------------------------------------------------- 1 | # Python Program to find the area of triangle 2 | 3 | a = 5 4 | b = 6 5 | c = 7 6 | 7 | # Uncomment below to take inputs from the user 8 | # a = float(input('Enter first side: ')) 9 | # b = float(input('Enter second side: ')) 10 | # c = float(input('Enter third side: ')) 11 | 12 | # calculate the semi-perimeter 13 | s = (a + b + c) / 2 14 | 15 | # calculate the area 16 | area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 17 | print('The area of the triangle is %0.2f' %area) 18 | -------------------------------------------------------------------------------- /2019/Sid-Sun/README.md: -------------------------------------------------------------------------------- 1 | # Sidharth Soni 2 | 3 | ### Day 0 4 | Start new project, structuring done 5 | 6 | ### Day 1 7 | Work on project crisp 8 | 9 | ### Day 2 10 | Work on project crisp 11 | 12 | 13 | ### Day 3 14 | Create new project for wearing out SSD (https://github.com/Sid-Sun/ssdWearOut) 15 | Fix segfault in codeMKII (https://github.com/Sid-Sun/codeMKII) 16 | 17 | ### Day 4 18 | 19 | 20 | ### Day 5 21 | -------------------------------------------------------------------------------- /2019/Sshashank18/README.md: -------------------------------------------------------------------------------- 1 | # Shashank Aggarwal 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Sumedha-shrivastava/README.md: -------------------------------------------------------------------------------- 1 | *Intro 2 | * Day-0 3 | -------------------------------------------------------------------------------- /2019/Taliya19/README.md: -------------------------------------------------------------------------------- 1 | # Taliya Khan 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Thtsuman/README.md: -------------------------------------------------------------------------------- 1 | # Suman Chakraborty 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/Tushargoyal02/README.md: -------------------------------------------------------------------------------- 1 | # Tushar Goyal 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/VarshitAgarwal/Day1_ML_LR: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import pprint 3 | from sklearn.datasets import load_boston 4 | from sklearn import linear_model 5 | from sklearn.model_selection import train_test_split 6 | 7 | boston = load_boston() 8 | # pprint.pprint(boston) 9 | df_x = pd.DataFrame(boston.data, columns = boston.feature_names) 10 | df_y = pd.DataFrame(boston.target) 11 | 12 | model = linear_model.LinearRegression() 13 | 14 | x_train, x_test, y_train, y_test = train_test_split(df_x, df_y, test_size = 0.2, random_state = 4 ) 15 | 16 | model.fit(x_train,y_train) 17 | 18 | results = model.predict(x_test) 19 | print(results[4] ) 20 | print(y_test) 21 | -------------------------------------------------------------------------------- /2019/VarshitAgarwal/README.md: -------------------------------------------------------------------------------- 1 | # Varshit Agarwal 2 | i am in 3 year pursing a bachelor of technology in the stream of computer science also know as computer geek just obsessed with high-end Technologies and also a Redhat Certified Professional. 3 | 4 | ### Day 1 5 | i started working on ML & DL algorithm i upload my first code of Linear Regression in one-variable using python ... 6 | 7 | ### Day 2 8 | 9 | 10 | ### Day 3 11 | -------------------------------------------------------------------------------- /2019/Vibs00/README.md: -------------------------------------------------------------------------------- 1 | *Intro 2 | * Day-0 3 | -------------------------------------------------------------------------------- /2019/aditya98ak/README.md: -------------------------------------------------------------------------------- 1 | # Aditya Kaushik 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/aishwarya11mar/README.md: -------------------------------------------------------------------------------- 1 | # Aishwarya Choathani 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/akkimah/README.md: -------------------------------------------------------------------------------- 1 | # Akanksha Maheshwari 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/akshaybengani/README.md: -------------------------------------------------------------------------------- 1 | # Akshay Bengani 2 | 3 | * Final Year BCA 4 | * Android Developer and Graphic Designer 5 | 6 | ## Plans for 100DaysOfCode 7 | 8 | * Build some great new Android Applications 9 | * Complete my last year online courses 10 | * Get placement in good company 11 | * Learn Python as a programming language for Algorithm design 12 | * Complete my project on encryption algorithm 13 | 14 | ### Day 1 : 26/01/2019 15 | Started 100 Days of code from today 16 | Continue my Python Lectures from my favourite Dr Chunk on coursera. 17 | 18 | ### Day 2 19 | 20 | 21 | ### Day 3 22 | -------------------------------------------------------------------------------- /2019/allenpbiju/README.md: -------------------------------------------------------------------------------- 1 | # Allen P Biju 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/arishta/README.md: -------------------------------------------------------------------------------- 1 | # Arishta Jain 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/ayushisaxena22050/README.md: -------------------------------------------------------------------------------- 1 | # Ayushi Saxena 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/ayushjain1144/README.md: -------------------------------------------------------------------------------- 1 | # Ayush Jain 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/ayushs/README.md: -------------------------------------------------------------------------------- 1 | # Ayush Sharma 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/bharatpurohit97/README.md: -------------------------------------------------------------------------------- 1 | # Bharat Purohit 2 | 3 | Bharat Purohit Here, 4 | 5 | Pursuing Graduate studies in Converging Technologies, leading to a career in Research. 6 | i get more interest in automating stuffs. my interest lies in Neural networks, Datascience and converging aspect of Neuro & Cognitive Science in Computer Science. 7 | 8 | 9 | - ### University - Centre For Converging Technologies, University of Rajasthan, Jaipur 10 | 11 | - ### Dual Degree B.Tech + M.Tech - Pre-Final Year 12 | 13 | # Day 1 14 | I am working on a project in Bioinformatics, Some kind of simualation for DNA. 15 | 16 | today i implemented multiprocessing for [Biosensor-Python](https://github.com/DBT-BIF/Biosensor-Python) class. 17 | 18 | The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a machine. 19 | 20 | i will make it online after running programme locally to all `Genomes` (approx) ~18,00,000. i will be more happy if anyone wants to learn more about project. 21 | 22 | 23 | # Day 2 24 | Today i worked on android app using React-native Framework. 25 | - setup local enviroment 26 | - created Login and Signup in js and route for Navigation 27 | - [committed](https://github.com/bharatpurohit97/LetsMatch/commit/64eb416fa2f8cd119f118f2ec8c8183b5214bee6) on Github. 28 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 10/StringTranslation.py: -------------------------------------------------------------------------------- 1 | # A simple android strings value translation script 2 | 3 | 4 | from googletrans import Translator 5 | import xml.etree.ElementTree as ET 6 | 7 | rootForWrittingData = ET.Element("resources") 8 | translator = Translator() 9 | 10 | # XML File Reading 11 | base_tree = ET.parse('strings.xml') 12 | nodes = [] 13 | root = base_tree.getroot() 14 | for child in root: 15 | node_name = str(child.attrib['name']) 16 | tvalue = str(translator.translate([str(child.text)], dest='es')[0].text) 17 | ET.SubElement(rootForWrittingData, "string", name=node_name).text = tvalue 18 | 19 | tree = ET.ElementTree(rootForWrittingData) 20 | tree.write("string-es.xml") -------------------------------------------------------------------------------- /2019/carotkut94/Day 11/TwoSum.py: -------------------------------------------------------------------------------- 1 | # Problem from AlgoExpert (can be found at LeetCode as well) 2 | # Name : TwoSum 3 | # Given an array of integers, return indices of the two numbers such that they add up to a specific target. 4 | # 5 | # You may assume that each input would have exactly one solution, and you may not use the same element twice. 6 | # Author : Sidhant Rajora 7 | 8 | 9 | # Solution 1 10 | # Using for loop two times to iterate over 11 | 12 | def twoNumberSumFor(array, target): 13 | for i in range(len(array) - 1): 14 | num = array[i] 15 | for j in range(i+1, len(array)): 16 | num2 = array[j] 17 | if num+num2 == target: 18 | return sorted([num, num2]) 19 | return [] 20 | 21 | 22 | print(twoNumberSumFor([3, 5, -4, 8, 11, 1, -1, 6], 10)) 23 | 24 | # Solution 2 25 | # Using HashMap or Dictionary 26 | 27 | 28 | def twoNumberSum(array, targetSum): 29 | table = {} 30 | for i in array: 31 | if targetSum - i in table: 32 | return sorted([targetSum-i, i]) 33 | else: 34 | table[i] = True 35 | return [] 36 | 37 | 38 | print(twoNumberSum([3, 5, -4, 8, 11, 1, -1, 6], 10)) 39 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 12/BST.py: -------------------------------------------------------------------------------- 1 | # A simple class to construct binary search tree 2 | 3 | class BST: 4 | def __init__(self, value): 5 | self.value = value 6 | self.left = None 7 | self.right = None 8 | 9 | def insert(self, value): 10 | currentNode = self 11 | while True: 12 | if value < currentNode.value: 13 | if currentNode.left is None: 14 | currentNode.left = BST(value) 15 | break 16 | else: 17 | currentNode = currentNode.left 18 | else: 19 | if currentNode.right is None: 20 | currentNode.right = BST(value) 21 | break 22 | else: 23 | currentNode = currentNode.right 24 | return self 25 | 26 | def contains(self, value): 27 | currentNode = self 28 | while currentNode is not None: 29 | if value < currentNode.value: 30 | currentNode = currentNode.left 31 | elif value > currentNode.value: 32 | currentNode = currentNode.right 33 | else: 34 | return True 35 | return False 36 | 37 | def remove(self, value, parentNode=None): 38 | currentNode = self 39 | while currentNode is not None: 40 | if value < currentNode.value: 41 | parentNode = currentNode 42 | currentNode = currentNode.left 43 | elif value > currentNode.value: 44 | parentNode = currentNode 45 | currentNode = currentNode.right 46 | else: 47 | if currentNode.left is not None and currentNode.right is not None: 48 | currentNode.value = currentNode.right.getMinValue() 49 | currentNode.right.remove(currentNode.value, currentNode) 50 | elif parentNode is None: 51 | if currentNode.left is not None: 52 | currentNode.value = currentNode.left.value 53 | currentNode.right = currentNode.left.right 54 | currentNode.left = currentNode.left.left 55 | elif currentNode.right is not None: 56 | currentNode.value = currentNode.right.value 57 | currentNode.left = currentNode.right.left 58 | currentNode.right = currentNode.right.right 59 | else: 60 | currentNode.value = None 61 | elif parentNode.left == currentNode: 62 | parentNode.left = currentNode.left if currentNode.left is not None else currentNode.right 63 | elif parentNode.right == currentNode: 64 | parentNode.right = currentNode.left if currentNode.left is not None else currentNode.right 65 | break 66 | return self 67 | 68 | def getMinValue(self): 69 | currentNode = self 70 | while currentNode.left is not None: 71 | currentNode = currentNode.left 72 | return currentNode.value -------------------------------------------------------------------------------- /2019/carotkut94/Day 13/UniqueMail.py: -------------------------------------------------------------------------------- 1 | # Every email consists of a local name and a domain name, separated by the @ sign 2 | # For example, in alice@leetcode.com, alice is the local name, and leetcode.com is the domain name. 3 | # Besides lowercase letters, these emails may contain '.'s or '+'s. 4 | # If you add periods ('.') between some characters in the local name part of an email address, mail sent there will be 5 | # forwarded to the same address without dots in the local name. 6 | # For example, "alice.z@leetcode.com" and "alicez@leetcode.com" 7 | # forward to the same email address. (Note that this rule does not apply for domain names.) 8 | # If you add a plus ('+') in the local name, everything after the first plus sign will be ignored. 9 | # This allows certain emails to be filtered, for example m.y+name@email.com will be forwarded to my@email.com. 10 | # (Again, this rule does not apply for domain names.) 11 | # It is possible to use both of these rules at the same time. 12 | # Given a list of emails, we send one email to each address in the list. 13 | # How many different addresses actually receive mails? 14 | 15 | 16 | # Author : Deathcode aka carotkut94 17 | 18 | class Solution: 19 | def numUniqueEmails(self, emails): 20 | messagesToSent = set() 21 | for mail in emails: 22 | local, domain = mail.split('@') 23 | if '+' in local: 24 | local = local[:local.index('+')] 25 | messagesToSent.add(local.replace('.', '') + '@' + domain) 26 | return len(messagesToSent) 27 | 28 | 29 | unqiue = Solution() 30 | print(unqiue.numUniqueEmails(emails=['sdha@gmail.com', 'sdha+asdasd@gmail.com', 's.dh.a@gmail.com'])) 31 | 32 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 13/UniqueMorse.py: -------------------------------------------------------------------------------- 1 | # Problem description can be found at https://leetcode.com/problems/unique-morse-code-words/ 2 | 3 | # first approach, its an easy problem 4 | 5 | 6 | class Solution: 7 | def uniqueMorseRepresentations(self, words): 8 | morse = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."] 9 | alphabets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] 10 | unique = set() 11 | data = "" 12 | for word in words: 13 | for l in word: 14 | data+=morse[alphabets.index(l)] 15 | unique.add(data) 16 | data = "" 17 | return len(unique) 18 | 19 | 20 | # Second approach with a bit of code reduction but kind of works the same as above code 21 | 22 | 23 | class Solution1: 24 | def uniqueMorseRepresentations(self, words): 25 | morse = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", 26 | "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."] 27 | alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 28 | 'u', 'v', 'w', 'x', 'y', 'z'] 29 | 30 | unique = {"".join(morse[alphabets.index(l)] for l in word) for word in words} 31 | return len(unique) -------------------------------------------------------------------------------- /2019/carotkut94/Day 14/Palindrome.py: -------------------------------------------------------------------------------- 1 | # A simple problem of checking if the given string a palindrome or not. 2 | # Author Sidhant Rajora 3 | 4 | 5 | # A simple solution is to like, create a reverse of the string and match it with the 6 | # original string 7 | 8 | 9 | def isPalindrome(string): 10 | # Write your code here. 11 | return string == string[::-1] 12 | 13 | 14 | # In this approach the reverse of string is need to be created(or iterated over) and 15 | # that's an extra overhead 16 | 17 | # So in second approach we can have two pointers, pointing to start of the string 18 | # and end of the string, and will keep on checking until we reach the middle of the string 19 | # and all goes well we return true, and at any particular point mismatch occurs we can 20 | # return false 21 | 22 | 23 | def isPalindrome2(string): 24 | left = 0 25 | right = len(string) - 1 26 | while (left < right): 27 | if string[left] != string[right]: 28 | return False 29 | left += 1 30 | right -= 1 31 | return True 32 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 15/Cipher.py: -------------------------------------------------------------------------------- 1 | # Ceaser Cipher encryption 2 | # Author Sidhant Rajora 3 | 4 | 5 | # first approach is to generate the new letter with the shift of provided key 6 | # and then join all the letters using join. 7 | 8 | # it takes O(n) time and O(n) space 9 | 10 | def encryptor(string, key): 11 | newLetters = [] 12 | clampedKey = key % 26 13 | for letter in string: 14 | newLetters.append(getShiftedLetter(letter, clampedKey)) 15 | return "".join(newLetters) 16 | 17 | 18 | def getShiftedLetter(letter, key): 19 | newLetterCode = ord(letter)+key 20 | return chr(newLetterCode) if newLetterCode <= 122 else chr(96+newLetterCode % 122) 21 | 22 | 23 | print(encryptor("xyz", 2)) 24 | 25 | 26 | """ 27 | Second approach it to store the alphabets in a list and add the key to index and return the character on the 28 | new index. 29 | """ 30 | 31 | 32 | def getLetter(l, clampedKey, alpha): 33 | newLetter = alpha.index(l)+clampedKey 34 | return alpha[newLetter] if newLetter <= 25 else alpha[-1 + newLetter % 25] 35 | 36 | 37 | def indexencryptor(string, key): 38 | newLetters = [] 39 | clampedKey = key % 26 40 | alpha = list("abcdefghijklmnopqrstuvwxyz") 41 | for l in string: 42 | newLetters.append(getLetter(l, clampedKey, alpha)) 43 | return "".join(newLetters) 44 | 45 | 46 | print(indexencryptor("xyz", 2)) 47 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 16/PalindromSubstring.py: -------------------------------------------------------------------------------- 1 | """ 2 | A problem in which we have to find out the longest palindromic substring from the given string 3 | """ 4 | 5 | 6 | """ 7 | First approach is to generate all the possible substring and check if it is the palindrome and it is longest 8 | if yes return it 9 | 10 | it will take O(n^3) time and O(1) space 11 | """ 12 | 13 | def longestpalindrome(string): 14 | longest = "" 15 | for i in range(len(string)): 16 | for j in range(i, len(string)): 17 | substring = string[i:j+1] 18 | if(len(substring)>len(longest)) and isPlalindrome(substring): 19 | longest = substring 20 | return longest 21 | 22 | 23 | def isPlalindrome(string): 24 | left = 0 25 | right = len(string) - 1 26 | while left < right: 27 | if string[left] != string[right]: 28 | return False 29 | left += 1 30 | right -= 1 31 | return True 32 | 33 | 34 | print(longestpalindrome("abaxyzzyxf")) 35 | 36 | 37 | """ 38 | Second approach is more optimal then the first approach, as it run in O(n^2) time rather then in 39 | O(n^3) 40 | """ 41 | 42 | 43 | def getLongestPalindrome(data, left, right): 44 | while left >= 0 and right < len(data): 45 | if data[left] != data[right]: 46 | break 47 | left -= 1 48 | right += 1 49 | return [left + 1, right] 50 | 51 | 52 | def optimalpalindrome(data): 53 | currentLongest = [0, 1] 54 | for i in range(1, len(data)): 55 | odd = getLongestPalindrome(data, i-1, i+1) 56 | even = getLongestPalindrome(data, i-1, i) 57 | longest = max(odd, even, key=lambda x: x[1] - x[0]) 58 | currentLongest = max(longest, currentLongest, key=lambda x: x[1]-x[0]) 59 | return data[currentLongest[0]:currentLongest[1]] 60 | 61 | 62 | print(optimalpalindrome("abaxyxxyxf")) 63 | 64 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 17/NthFibonacci.py: -------------------------------------------------------------------------------- 1 | """ 2 | A problem in which we have to find out the nth fibonacci number 3 | 4 | Author Sidhant Rajora 5 | """ 6 | 7 | """ 8 | In order to solve it the naive approach is to generate all the fibonacci upto given and return it 9 | """ 10 | 11 | 12 | def getFibOnN(n): 13 | if n == 2: 14 | return 1 15 | elif n == 1: 16 | return 0 17 | else: 18 | return getFibOnN(n - 1) + getFibOnN(n - 2) 19 | 20 | 21 | print(getFibOnN(10)) 22 | 23 | """ 24 | Another approach is to memorize all the fibonacci numbers 25 | """ 26 | 27 | 28 | def getByMemorization(n, memorize={1: 0, 2: 1}): 29 | if n in memorize: 30 | return memorize[n] 31 | else: 32 | memorize[n] = getByMemorization(n - 1, memorize) + getByMemorization(n - 2, memorize) 33 | return memorize[n] 34 | 35 | 36 | print(getByMemorization(10)) 37 | 38 | """" 39 | Using counter and list to store the next and previous fib number, without recursion 40 | """ 41 | 42 | 43 | def getCountedFibonacci(n): 44 | lastTwo = [0, 1] 45 | counter = 3 46 | while counter <= n: 47 | nextFib = lastTwo[0] + lastTwo[1] 48 | lastTwo[0] = lastTwo[1] 49 | lastTwo[1] = nextFib 50 | counter += 1 51 | return lastTwo[1] if n > 1 else lastTwo[0] 52 | 53 | 54 | print(getCountedFibonacci(10)) 55 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 18/LevenshteinDistance.py: -------------------------------------------------------------------------------- 1 | """ 2 | A problem that typically stats about transformation of a given string into another string by making edit operations 3 | like insert, remove and substitution of a character. 4 | 5 | We need to find out those minimum number of operations 6 | 7 | Author Sidhant Rajora 8 | """ 9 | 10 | 11 | def lDistance(sample, target): 12 | 13 | countOfChanges = [[x for x in range(len(sample)+1)] for y in range(len(target)+1)] 14 | print(countOfChanges) 15 | for i in range(1, len(target)+1): 16 | countOfChanges[i][0] = countOfChanges[i-1][0] + 1 17 | for i in range(1, len(target)+1): 18 | for j in range(1, len(sample)+1): 19 | if target[i-1] == sample[j-1]: 20 | countOfChanges[i][j] = countOfChanges[i-1][j-1] 21 | else: 22 | countOfChanges[i][j] = 1 + min(countOfChanges[i-1][j-1], countOfChanges[i-1][j], countOfChanges[i][j-1]) 23 | print(countOfChanges) 24 | # Select the last array from list and select the last element of that array 25 | return countOfChanges[-1][-1] 26 | 27 | 28 | print(lDistance("abc", "yabd")) 29 | 30 | 31 | """ 32 | After taking look on the more optimized solution(slightly) 33 | """ 34 | 35 | 36 | def OlDistance(sample, target): 37 | small = sample if len(sample)= len(target) else target 39 | evenEdits = [x for x in range(len(small)+1)] 40 | oddEdits = [None for x in range(len(small)+1)] 41 | for i in range(1, len(big)+1): 42 | if i % 2 == 1: 43 | currentEdits = oddEdits 44 | previousEdits = evenEdits 45 | else: 46 | currentEdits = evenEdits 47 | previousEdits = oddEdits 48 | currentEdits[0] = i 49 | for j in range(1, len(small)+1): 50 | if big[i-1] == small[j-1]: 51 | currentEdits[j] = previousEdits[j-1] 52 | else: 53 | currentEdits[j] = 1 + min(previousEdits[j-1], previousEdits[j], currentEdits[j-1]) 54 | return evenEdits[-1] if len(big) % 2 == 0 else oddEdits[-1] 55 | 56 | 57 | print(OlDistance("abc", "yabd")) -------------------------------------------------------------------------------- /2019/carotkut94/Day 19/BinarySearch.py: -------------------------------------------------------------------------------- 1 | """ 2 | We will implement the standard binary search algorithm read more about it at 3 | https://en.wikipedia.org/wiki/Binary_search_algorithm 4 | Author Sidhant Rajora 5 | """ 6 | 7 | 8 | 9 | def binarySearch(array, target): 10 | return doSearch(array, target, 0, len(array)-1) 11 | 12 | 13 | def doSearch(array, target, start, end): 14 | while start < end: 15 | mid = (start+end) // 2 16 | matchable = array[mid] 17 | if target == matchable: 18 | return mid 19 | elif target < matchable: 20 | end = mid - 1 21 | else: 22 | start = mid + 1 23 | 24 | 25 | print(binarySearch([1, 4, 5, 6, 7, 8, 9], 8)) 26 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 19/ShiftedBinarySearch.py: -------------------------------------------------------------------------------- 1 | """ 2 | We will implement the binary search in a rotated or shifted array 3 | 4 | Author Sidhant Rajora 5 | """ 6 | 7 | def shitedSearch(array, target): 8 | return doSearch(array, target, 0, len(array)-1) 9 | 10 | 11 | def doSearch(array, target, start, end): 12 | if start > end: 13 | return -1 14 | mid = (start + end) // 2 15 | match = array[mid] 16 | leftNum = array[start] 17 | rightNum = array[end] 18 | if target == match: 19 | return mid 20 | elif leftNum <= match: 21 | if match > target >= leftNum: 22 | return doSearch(array, target, start, mid) 23 | else: 24 | return doSearch(array, target, mid + 1, end) 25 | else: 26 | if match < target <= rightNum: 27 | return doSearch(array, target, mid + 1, end) 28 | else: 29 | return doSearch(array, target, start, mid - 1) 30 | 31 | 32 | print(shitedSearch([3, 4, 1, 2], 1)) 33 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 2/Unique.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 2. 2 | # Source Leetcode : https://leetcode.com/problems/single-number 3 | # Statement : Given a non empty array of integers, every element is repeated twice except for one, 4 | # find that single unique number 5 | # Author : Deathcode aka carotkut94 6 | 7 | # I started of with a mathematical approach to solve this problem 8 | # Lets assume that we have an array [4,4,1,3,3,1,2] 9 | # and the sum of the array is sum([4,4,1,3,3,1,2]) = 18 10 | # and if I find the sum of unique elements of the array i.e sum([4,1,3,2]) = 10 and if I double this i.e 10*2 = 20 11 | # and if I subtract the sum of all number from twic the sum of unique elements of the array we will get the unique 12 | # number i.e 20-18 = 2 and we can see that 2 is our number. 13 | 14 | a = [4, 4, 1, 3, 3, 1, 2] 15 | sumOfAll = sum(a) 16 | twiceUniqueSum = 2*(sum(set(a))) 17 | 18 | print(twiceUniqueSum-sumOfAll) 19 | 20 | # On the other i realized that this approach has its own flaws, it is mathematical in nature but requires more space 21 | # Then after looking in it, i realized XOR operation can be done and it will return the unique number to me. 22 | 23 | a = [4, 4, 1, 3, 3, 1, 2] 24 | x = 0 25 | for i in a: 26 | x ^= i 27 | print(x) 28 | 29 | # In this approach the time complexity will remain the same i.e O(n) but not extra space is used. 30 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 20/TripletSum.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is a problem similar to two sum , in this problem we are given a non-empty array of integers 3 | and a target sum, we need to return all the triplets resulting into the target. 4 | 5 | Author Sidhant Rajora 6 | """ 7 | 8 | 9 | def tripletSum(array, target): 10 | array.sort() 11 | triplets = [] 12 | for i in range(len(array)-2): 13 | left = i + 1 14 | right = len(array)-1 15 | while left < right: 16 | currentSum = array[i]+array[left]+array[right] 17 | if currentSum == target: 18 | triplets.append([array[i], array[left], array[right]]) 19 | left += 1 20 | right -= 1 21 | elif currentSum < target: 22 | left += 1 23 | elif currentSum > target: 24 | right -= 1 25 | return triplets 26 | 27 | 28 | print(tripletSum([12, 3, 1, 2, -6, 5, -8, 6], 0)) 29 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 21/SmalletsDifference.py: -------------------------------------------------------------------------------- 1 | """ 2 | In this problem we are given two non empty arrays and we need to find the pair such that first element from first array 3 | and second element of the pair will be from the second array and the difference between pair element is closest 4 | to zero(0) 5 | 6 | 7 | Author Sidhant Rajora 8 | """ 9 | 10 | 11 | def smallDiff(array1, array2): 12 | array1.sort() 13 | array2.sort() 14 | index1 = 0 15 | index2 = 0 16 | smallest = float("inf") 17 | smallPair = [] 18 | while index1 < len(array1) and index2 < len(array2): 19 | f = array1[index1] 20 | s = array2[index2] 21 | if f < s: 22 | current = s - f 23 | index1 += 1 24 | elif s < f: 25 | current = f - s 26 | index2 += 1 27 | else: 28 | return [f, s] 29 | if smallest > current: 30 | smallest = current 31 | smallPair = [f, s] 32 | return smallPair 33 | 34 | 35 | print(smallDiff([-1, 5, 10, 20, 28, 3], [26, 134, 135, 15, 17])) 36 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 22/HeapSort.py: -------------------------------------------------------------------------------- 1 | """ 2 | Standard heap sort implementation, more about heap sort can be found at : https://en.wikipedia.org/wiki/Heapsort 3 | 4 | 5 | Author Sidhant Rajora 6 | """ 7 | 8 | 9 | def heap_sort(array): 10 | buildMaxHeap(array) 11 | for end in reversed(range(1, len(array))): 12 | swap(0, end, array) 13 | shiftDown(0, end - 1, array) 14 | return array 15 | 16 | 17 | def buildMaxHeap(array): 18 | firstParent = (len(array) - 2) // 2 19 | for i in reversed(range(firstParent+1)): 20 | shiftDown(i, len(array)-1, array) 21 | 22 | 23 | def shiftDown(current, end, heap): 24 | child = current * 2 + 1 25 | while child <= end: 26 | child2 = current * 2 + 2 if current * 2 + 2 <= end else -1 27 | if child2 > -1 and heap[child2] > heap[child]: 28 | swapIndex = child2 29 | else: 30 | swapIndex = child 31 | if heap[swapIndex] > heap[current]: 32 | swap(current, swapIndex, heap) 33 | current = swapIndex 34 | child = current * 2 +1 35 | else: 36 | return 37 | 38 | 39 | def swap(i, j, array): 40 | array[i], array[j] = array[j], array[i] 41 | 42 | 43 | print(heap_sort([8, 7, 4, 2])) 44 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 23/Permutation.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | 4 | Author Sidhant Rajora 5 | """ 6 | 7 | 8 | def getPermutation(array): 9 | perm = [] 10 | permHelper(array, [], perm) 11 | return perm 12 | 13 | 14 | def permHelper(array, current, perm): 15 | if not len(array) and len(current): 16 | perm.append(current) 17 | else: 18 | for i in range(len(array)): 19 | newArray = array[:i] + array[i + 1:] 20 | newPerm = current + [array[i]] 21 | permHelper(newArray, newPerm, perm) 22 | 23 | 24 | print(getPermutation([1, 2, 3])) 25 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 24/BinaryNumbers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Problem description can be found at https://www.hackerrank.com/challenges/30-binary-numbers/problem 3 | 4 | Aurthor Sidhant Rajora 5 | """ 6 | 7 | 8 | n = int(input()) 9 | max_count = 0 10 | one_count = 0 11 | 12 | while n>0: 13 | factor = n // 2 14 | rem = n - 2 * factor 15 | n = factor 16 | if rem == 1: 17 | one_count += 1 18 | max_count = max(max_count,one_count) 19 | else: 20 | one_count = 0 21 | print(max_count) 22 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 25/AbsoluteMinimum.py: -------------------------------------------------------------------------------- 1 | """ 2 | Absolute minimum difference with one removal operation on entire array 3 | 4 | Author Sidhant Rajora 5 | """ 6 | 7 | def minimumSumArrat(A): 8 | minimum = max(A) 9 | for i in A: 10 | sumofminimum = 0 11 | tempList = A.copy() 12 | tempList.remove(i) 13 | for i in range(1, len(tempList)): 14 | sumofminimum += abs(tempList[i-1]-tempList[i]) 15 | if sumofminimum <= minimum: 16 | minimum = sumofminimum 17 | return minimum 18 | 19 | 20 | print(minimumSumArrat([1, 5, 3, 2, 10])) 21 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 26/KadaneAlgorithm.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of kadane's algorithm 3 | https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ 4 | 5 | Author Sidhant Rajora 6 | """ 7 | 8 | 9 | def kadaneAlgo(array): 10 | maxEnding = array[0] 11 | maxSoFar = array[0] 12 | for i in range(1, len(array)): 13 | num = array[i] 14 | maxEnding = max(num, maxEnding + num) 15 | maxSoFar = max(maxSoFar, maxEnding) 16 | return maxSoFar 17 | 18 | 19 | print(kadaneAlgo([1, 2, 3, -3, -1, 4, 5, -1, 6])) 20 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 27/KMPAlgo.py: -------------------------------------------------------------------------------- 1 | """ 2 | KMP(Knuth-Morris-Pratt) String searching algorithm 3 | read more about it at https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm 4 | 5 | Author Sidhant Rajora 6 | """ 7 | 8 | 9 | def patternBuilder(substring): 10 | pattern = [-1 for i in substring] 11 | j = 0 12 | i = 0 13 | while i < len(substring): 14 | if substring[i] == substring[j]: 15 | pattern[i] = j 16 | i += 1 17 | j += 1 18 | elif j > 0: 19 | j = pattern[j-1] + 1 20 | else: 21 | i += 1 22 | return pattern 23 | 24 | 25 | def doesMatch(string, substring, pattern): 26 | i = 0 27 | j = 0 28 | while i + len(substring) - j <= len(string): 29 | if string[i] == substring[j]: 30 | if j == len(substring) - 1: 31 | return True 32 | i += 1 33 | j += 1 34 | elif j > 0: 35 | j = pattern[j-1] + 1 36 | else: 37 | i += 1 38 | return False 39 | 40 | 41 | def execuetKMP(string, substring): 42 | pattern = patternBuilder(substring) 43 | return doesMatch(string, substring, pattern) 44 | 45 | 46 | print(execuetKMP("aefoaefcdaefcdaed", "aefcdaed")) 47 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 28/Largest3.py: -------------------------------------------------------------------------------- 1 | """ 2 | A function for returning the sorted array of largest three numbers out of the given array 3 | 4 | Author Sidhant Rajora 5 | """ 6 | 7 | def find(array): 8 | three = [None, None, None] 9 | for num in array: 10 | update(three, num) 11 | return three 12 | 13 | 14 | def update(three, num): 15 | if three[2] is None or num > three[2]: 16 | shift(three, num, 2) 17 | elif three[1] is None or num > three[1]: 18 | shift(three, num, 1) 19 | elif three[0] is None or num > three[0]: 20 | shift(three, num, 0) 21 | 22 | 23 | def shift(array, num, index): 24 | for i in range(index+1): 25 | if i == index: 26 | array[i] = num 27 | else: 28 | array[i] = array[i+1] 29 | 30 | 31 | print(find([1, 6, 3, 6, 90, 2, 4, 68, 354, 235, 4, 567])) 32 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 29/FourNumberSum.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | find out all subarray containing four numbers such that their sum is equal to target sum 4 | 5 | Author Sidhant Rajora 6 | """ 7 | 8 | 9 | def fourSum(array, target): 10 | allPair = {} 11 | four = [] 12 | for i in range(1, len(array) - 1): 13 | for j in range(i + 1, len(array)): 14 | currentSum = array[i] + array[j] 15 | diff = target - currentSum; 16 | if diff in allPair: 17 | for pair in allPair[diff]: 18 | four.append(pair + [array[i], array[j]]) 19 | for k in range(0, 1): 20 | currentSum = array[i] + array[k] 21 | if currentSum not in allPair: 22 | allPair[currentSum] = [[array[k], array[i]]] 23 | else: 24 | allPair[currentSum].append([array[k], array[i]]) 25 | return four 26 | 27 | 28 | print(fourSum([7, 6, 4, -1, 1, 2], 16)) 29 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 3/EvenSum.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 3. 2 | # Source Project Euler : https://projecteuler.net/problem=2 3 | # Statement : Each new term in the Fibonacci sequence is generated by adding the previous two terms. 4 | # By starting with 1 and 2, the first 10 terms will be: 5 | # 6 | # 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... 7 | # 8 | # By considering the terms in the Fibonacci sequence whose values do not exceed four million, 9 | # find the sum of the even-valued terms. 10 | 11 | # Author : Deathcode aka carotkut94 12 | 13 | # I started with the bruteforce approach by generating fibonacci number and checking it 14 | # if it is an even or odd and then adding it to total if even 15 | 16 | 17 | def fib(n): 18 | if n == 0: 19 | return 0 20 | elif n == 1: 21 | return 1 22 | else: 23 | return fib(n-1)+fib(n-2) 24 | 25 | 26 | n = 0 27 | total = 0 28 | while True: 29 | f = fib(n) 30 | n += 1 31 | if f > 4000001: 32 | break 33 | if f % 2 == 0: 34 | total = total + f 35 | print(total) 36 | 37 | # and after solving this problem I wrote a quite of long list of fibonacci numbers like 1, 1, 2, 3, 5, 8, 13, 21, 34, 38 | # 55, 89, 144, 233, 377, 610 after seeing them for quite a while i saw that even numbered fibonacci number is preceded 39 | # and succeeded by 2 odd numbers i.e whole list can be seen as odd, odd, EVEN, odd, odd, EVEN, odd, odd, EVEN and soo on 40 | # and now if we see clearly we just have to find a way via which we just have to remove all odd numbers from the list 41 | # Here we have to change the N1 to 2 as first even fibonacci is 2 and N2 as 8 as second fibonacci sequence is 8, and 42 | # other next fibonacci numbers can be generated as 4*N2+N1 i.e 4*8 + 2 = 34 and now N1 and N2 will be swapped and this 43 | # will reduce the runtime of the app 44 | 45 | 46 | def fib2(n): 47 | f1 = 2 48 | f2 = 8 49 | total = 10 50 | while True: 51 | fn = 4 * f2 + f1 52 | if fn >= n: 53 | return total 54 | total += fn 55 | f1, f2 = f2, fn 56 | 57 | 58 | print(fib2(4000001)) 59 | 60 | # for further improvement I read that their exists a formula know as Binet's Formula which can be found at 61 | # https://en.wikipedia.org/wiki/Fibonacci_number#Relation_to_the_golden_ratio 62 | # I am studying this, once i have a clear picture of it, i will implement it too. 63 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 30/MinJumps.py: -------------------------------------------------------------------------------- 1 | """ 2 | You are given a non-empty array of integers. Each element represents the maximum number of steps you can take forward. 3 | For example, if the element at index 1 is 3, you can go from index 1 to index 2, 3, or 4. 4 | Write a function that returns the minimum number of jumps needed to reach the final index. Note that jumping from 5 | index i to index i + x always constitutes 1 jump, no matter how large x is. 6 | 7 | Author Sidhant Rajora 8 | """ 9 | 10 | 11 | def minJumps(array): 12 | if len(array) == 1: 13 | return 0 14 | jumps = 0 15 | reach = array[0] 16 | steps = array[0] 17 | for i in range(1, len(array) - 1): 18 | reach = max(reach, i + array[i]) 19 | steps -= 1 20 | if steps == 0: 21 | jumps += 1 22 | steps = reach - i 23 | return jumps + 1 24 | 25 | 26 | print(minJumps([3, 4, 2, 1, 2, 3, 7, 1, 1, 1, 3])) 27 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 31/LargestRange.py: -------------------------------------------------------------------------------- 1 | """ 2 | Write a function that takes in an array of integers and returns an array of length 2 representing the largest range of 3 | numbers contained in that array. The first number in the output array should be the first number in the range while the 4 | second number should be the last number in the range. A range of numbers is defined as a set of numbers that come right 5 | after each other in the set of real integers. For instance, the output array [2, 6] represents the range 6 | {2, 3, 4, 5, 6}, which is a range of length 5. Note that numbers do not need to be ordered or adjacent in the array in 7 | order to form a range. Assume that there will only be one largest range. 8 | 9 | 10 | Author Sidhant Rajora 11 | """ 12 | 13 | 14 | def largestRange(array): 15 | best = [] 16 | longest = 0 17 | nums = {} 18 | for num in array: 19 | nums[num] = True 20 | for num in array: 21 | if not nums[num]: 22 | continue 23 | nums[num] = False 24 | current = 1 25 | left = num - 1 26 | right = num + 1 27 | while left in nums: 28 | nums[left] = False 29 | current += 1 30 | left -= 1 31 | while right in nums: 32 | nums[right] = False 33 | current += 1 34 | right += 1 35 | if current > longest: 36 | longest = current 37 | best = [left+1, right-1] 38 | return best 39 | 40 | 41 | print(largestRange([1, 11, 3, 0, 15, 5, 2, 4, 10, 7, 12, 6])) -------------------------------------------------------------------------------- /2019/carotkut94/Day 32/MaximumDifference.py: -------------------------------------------------------------------------------- 1 | """ 2 | Given an array arr[] of integers, find out the maximum 3 | difference between any two 4 | elements such that larger element appears after the smaller number. 5 | """ 6 | 7 | """ 8 | this is a naive approach that runs in O(n^2) 9 | """ 10 | 11 | 12 | def maxDiff(arr): 13 | max_diff = arr[1] - arr[0] 14 | 15 | for i in range(0, len(arr)): 16 | for j in range(i + 1, len(arr)): 17 | if arr[j] - arr[i] > max_diff: 18 | print(arr[j]) 19 | print(arr[i]) 20 | print(max_diff) 21 | max_diff = arr[j] - arr[i] 22 | print(max_diff) 23 | print("=============index==============") 24 | print(i) 25 | print(j) 26 | print('++++++++++++++++++++++++++++') 27 | return max_diff 28 | 29 | 30 | #print(maxDiff([2, 3, 10, 6, 4, 8, 1])) 31 | 32 | """ 33 | Efficient approach over the proposed solution above 34 | """ 35 | def effDiffMax(arr, l): 36 | max_diff = arr[1] - arr[0] 37 | min_element = arr[0] 38 | 39 | for i in range(1, l): 40 | if arr[i] - min_element > max_diff: 41 | max_diff = arr[i] - min_element 42 | 43 | if arr[i] < min_element: 44 | min_element = arr[i] 45 | return max_diff 46 | 47 | 48 | print(effDiffMax([1, 2, 6, 80, 100], 5)) 49 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 33/AddTwoNumbers.py: -------------------------------------------------------------------------------- 1 | """ 2 | You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order 3 | and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. 4 | You may assume the two numbers do not contain any leading zero, except the number 0 itself. 5 | 6 | 7 | Author : Sidhant Rajora 8 | 9 | Problem statement can be found at : https://leetcode.com/problems/add-two-numbers/ 10 | """ 11 | 12 | 13 | class ListNode: 14 | def __init__(self, x): 15 | self.val = x 16 | self.next = None 17 | 18 | class Solution: 19 | def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: 20 | if l1 == None: 21 | return l2 22 | if l2 == None: 23 | return l1 24 | start = l1 25 | carry = (l1.val+l2.val)//10 26 | l1.val = (l1.val+l2.val)%10 27 | while l1.next != None and l2.next!=None: 28 | carry += l1.next.val 29 | carry += l2.next.val 30 | l1.next.val = carry % 10 31 | carry = carry // 10 32 | l1 = l1.next 33 | l2 = l2.next 34 | if l1.next == None: 35 | l1.next = l2.next 36 | while l1.next != None: 37 | carry += l1.next.val 38 | l1.next.val = carry % 10 39 | carry = carry // 10 40 | l1 = l1.next 41 | if carry>0: 42 | l1.next = ListNode(carry) 43 | return start -------------------------------------------------------------------------------- /2019/carotkut94/Day 34/JewelsAndStones.py: -------------------------------------------------------------------------------- 1 | """ 2 | You're given strings J representing the types of stones that are jewels, and S representing the stones you have. 3 | Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels. 4 | 5 | This problem can be found at : https://leetcode.com/problems/jewels-and-stones/ 6 | 7 | Author: Sidhant Rajora 8 | """ 9 | 10 | 11 | def numJewelsInStones(J: str, S: str) -> int: 12 | count = 0 13 | for c in J: 14 | count += S.count(c) 15 | return count 16 | 17 | 18 | print(numJewelsInStones("aA", "aAAbbbbbb")) 19 | 20 | 21 | # Another variant is to create a set out of the J 22 | 23 | 24 | def numJewelsInStonesSet(J: str, S: str) -> int: 25 | count = 0 26 | unique = list(set(J)) 27 | for c in unique: 28 | count += S.count(c) 29 | return count 30 | 31 | 32 | print(numJewelsInStonesSet("aA", "aAAbbbbbb")) 33 | 34 | 35 | # And using string comprehension and runtime is 36ms 36 | 37 | def numJewelsInStonesCom(J: str, S: str) -> int: 38 | unique = list(set(J)) 39 | return len([c for c in S if c in unique]) 40 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 4/RotateArray.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 4. 2 | # Source HackerRank : https://www.hackerrank.com/challenges/ctci-array-left-rotation 3 | # Statement : A left rotation operation on an array shifts each of the array's elements 1 unit to the left. For example, 4 | # if 2 left rotations are performed on array [1,2,3,4,5] , then the array would become [3,4,5,1,2]. 5 | # Given an array a of n integers and a number,d, perform d left rotations on the array. Return the updated array 6 | # to be printed as a single line of space-separated integers. 7 | 8 | 9 | # Author : Deathcode aka carotkut94 10 | 11 | # It is an easy problem and i just pasted the code i did on hackerrank, but modified it a little 12 | 13 | 14 | def rotate_left(a, d): 15 | temp_result = a[d % len(a):len(a)]+a[0:d % len(a)] 16 | return temp_result 17 | 18 | 19 | if __name__ == '__main__': 20 | a = [1, 2, 3, 4, 5] 21 | d = 2 22 | result = rotate_left(a, d) 23 | print(result) 24 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 5/HourGlass.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 5. 2 | # Source HackerRank : https://www.hackerrank.com/challenges/2d-array 3 | # Statement : https://www.hackerrank.com/challenges/2d-array 4 | 5 | 6 | # Solution 7 | 8 | import os 9 | 10 | rows = 6 11 | columns = 6 12 | 13 | 14 | def hourglass_sum(arr): 15 | max_sum = -9 * 9 16 | for i in range(rows - 2): 17 | for j in range(columns - 2): 18 | sum = (arr[i][j]+arr[i][j+1]+arr[i][j+2]+arr[i+1][j+1]+arr[i+2][j]+arr[i+2][j+1]+arr[i+2][j+2]) 19 | max_sum = max(max_sum, sum) 20 | 21 | return max_sum 22 | 23 | 24 | if __name__ == '__main__': 25 | fptr = open(os.environ['OUTPUT_PATH'], 'w') 26 | 27 | arr = [] 28 | 29 | for _ in range(6): 30 | arr.append(list(map(int, input().rstrip().split()))) 31 | 32 | result = hourglass_sum(arr) 33 | 34 | fptr.write(str(result) + '\n') 35 | 36 | fptr.close() 37 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 6/ClassesAndObjects.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 6. 2 | # Source HackerRank : https://www.hackerrank.com/challenges/30-inheritance/problem 3 | # Statement : https://www.hackerrank.com/challenges/30-inheritance/problem 4 | 5 | 6 | # Solution 7 | 8 | class Person: 9 | def __init__(self, firstName, lastName, idNumber): 10 | self.firstName = firstName 11 | self.lastName = lastName 12 | self.idNumber = idNumber 13 | 14 | def printPerson(self): 15 | print("Name:", self.lastName + ",", self.firstName) 16 | print("ID:", self.idNumber) 17 | 18 | 19 | class Student(Person): 20 | # Class Constructor 21 | # 22 | # Parameters: 23 | # firstName - A string denoting the Person's first name. 24 | # lastName - A string denoting the Person's last name. 25 | # id - An integer denoting the Person's ID number. 26 | # scores - An array of integers denoting the Person's test scores. 27 | # 28 | # Write your constructor here 29 | 30 | # Function Name: calculate 31 | # Return: A character denoting the grade. 32 | # 33 | # Write your function here 34 | def __init__(self, fname, lname, idNumber, scores): 35 | super().__init__(fname, lname, idNumber) 36 | self.scores = scores 37 | 38 | def calculate(self): 39 | total = 0 40 | for score in scores: 41 | total += score 42 | 43 | avg = total / len(self.scores) 44 | 45 | if 90 <= avg <= 100: 46 | return 'O' 47 | if 80 <= avg < 90: 48 | return 'E' 49 | if 70 <= avg < 80: 50 | return 'A' 51 | if 55 <= avg < 70: 52 | return 'P' 53 | if 40 <= avg < 55: 54 | return 'D' 55 | return 'T' 56 | 57 | 58 | line = input().split() 59 | firstName = line[0] 60 | lastName = line[1] 61 | idNum = line[2] 62 | numScores = int(input()) # not needed for Python 63 | scores = list(map(int, input().split())) 64 | s = Student(firstName, lastName, idNum, scores) 65 | s.printPerson() 66 | print("Grade:", s.calculate()) -------------------------------------------------------------------------------- /2019/carotkut94/Day 7/MergeSort.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 7. 2 | # Source Wikipedia : https://en.wikipedia.org/wiki/Merge_sort 3 | # Statement : Merge Sort implementation 4 | 5 | 6 | # Implementation 7 | 8 | 9 | def merge_lists(left, right): 10 | i, j = 0, 0 11 | result = [] 12 | while i < len(left) and j < len(right): 13 | if left[i] <= right[j]: 14 | result.append(left[i]) 15 | i += 1 16 | else: 17 | result.append(right[j]) 18 | j += 1 19 | result += left[i:] 20 | result += right[j:] 21 | return result 22 | 23 | 24 | def merge_sort(input_list): 25 | if len(input_list) <= 1: 26 | return input_list 27 | else: 28 | m = int(len(input_list) / 2) 29 | l = merge_sort(input_list[:m]) 30 | r = merge_sort(input_list[m:]) 31 | return merge_lists(l, r) 32 | 33 | 34 | number_list = [3, 1, 5, 10, 3, 4, 2, 9, 8, 11, 34, 26, 72, 13, 151, 16] 35 | print(merge_sort(number_list)) 36 | 37 | 38 | # I read an academic paper on modified merge sort, once i get hold of that paper and algorithm 39 | # I will implement that too and will see how does both of those work on last data set 40 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 8/QuickSort.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 8. 2 | # Source Wikipedia : https://en.wikipedia.org/wiki/Quick_sort 3 | # Statement : Quick Sort implementation 4 | 5 | 6 | # Implementation 7 | 8 | def quicksort(x): 9 | if len(x) == 1 or len(x) == 0: 10 | return x 11 | else: 12 | pivot = x[0] 13 | i = 0 14 | for j in range(len(x) - 1): 15 | if x[j + 1] < pivot: 16 | x[j + 1], x[i + 1] = x[i + 1], x[j + 1] 17 | i += 1 18 | x[0], x[i] = x[i], x[0] 19 | p1 = quicksort(x[:i]) 20 | p2 = quicksort(x[i + 1:]) 21 | p1.append(x[i]) 22 | return p1 + p2 23 | 24 | 25 | number_list = [3, 1, 5, 10, 3, 4, 2, 9, 8, 11, 34, 26, 72, 13, 151, 16] 26 | print(quicksort(number_list)) 27 | -------------------------------------------------------------------------------- /2019/carotkut94/Day 9/DataDumper.py: -------------------------------------------------------------------------------- 1 | # I encountered a problem of data dumping faced by my colleagues 2 | # I wrote this script for them for data entry 3 | 4 | 5 | import time 6 | import mysql.connector 7 | import xlrd 8 | 9 | db = mysql.connector.connect( 10 | host="localhost", 11 | user="root", 12 | password="", 13 | database="sample" 14 | ) 15 | 16 | cursor = db.cursor() 17 | 18 | workbook = xlrd.open_workbook("car.xlsx") 19 | sheet = workbook.sheet_by_index(0) 20 | print(sheet.nrows) 21 | for rowx in range(sheet.nrows): 22 | row = sheet.row_values(rowx) 23 | model_name = row[0] 24 | fuel_type = row[1] 25 | customer_service_rate = row[2] 26 | partner_service_rate = row[3] 27 | service_id = 44 28 | vehicle_type = 1 29 | modified_date = time.time() 30 | created_date = time.time() 31 | estimated_time = "" 32 | 33 | mysql = """insert into services_available_for_models(model_id, service_id, vehicle_type_id, fuel_type_id, estimated_time,company_service_rate,partner_service_rate,created,modified) value(%s,%s,%s,%s,%s,%s,%s,%s,%s)""" 34 | 35 | val = (model_name, service_id, vehicle_type, fuel_type, estimated_time, customer_service_rate, partner_service_rate, 36 | created_date, modified_date) 37 | cursor.execute(mysql, val) 38 | db.commit() 39 | print(mysql) 40 | -------------------------------------------------------------------------------- /2019/carotkut94/Day1/3or5.py: -------------------------------------------------------------------------------- 1 | # Solution statement for the problem statement of Day 1. 2 | # Source Project Euler : https://projecteuler.net/problem=1 3 | 4 | # Author : DeathCode94 aka carotkut94 5 | 6 | # A holder variable for holding the upper limit for getting the sum of multiple of 3 or 5 7 | # Simple solution involves a naive approach and involves a new list that consist the multiples and that list will have 8 | # duplicate numbers like 15, 45 etx, then we can construct a set with those values and then we can call the sum method 9 | 10 | UPPER_LIMIT = 1000 11 | listOfNumbers = [] 12 | for i in range(0, UPPER_LIMIT, 3): 13 | listOfNumbers.append(i) 14 | 15 | for i in range(0, UPPER_LIMIT, 5): 16 | listOfNumbers.append(i) 17 | 18 | print(sum(set(listOfNumbers))) 19 | 20 | # Using not in python 21 | tempSum = 0 22 | for i in range(UPPER_LIMIT): 23 | if not (i % 3 and i % 5): 24 | tempSum += i 25 | print(tempSum) 26 | 27 | # Single line solution for the problem statement using list comprehension 28 | print(sum(i for i in range(UPPER_LIMIT) if not (i % 3 and i % 5))) 29 | 30 | 31 | # All of the above methods returns the same output. 32 | -------------------------------------------------------------------------------- /2019/chetan915719/README.md: -------------------------------------------------------------------------------- 1 | # Chetan Tiwari 2 | * *2nd Year CSE, SKIT Jaipur* 3 | * *Learning Python and Networking* 4 | 5 | ## Plans for 100DaysOfCode 6 | - [ ] Improving Problem Solving 7 | - [ ] Improving Python Skills 8 | - [ ] Learn About Block Chain 9 | - [ ] Complete Networking Course on Cybrary 10 | 11 | ### Day 1 : Jan 1st 2019 12 | #### T-101 13 | * Learned How to use GitHub 14 | * Prepared My Introducation Here and Planning here. 15 | #### T-102 16 | * Practice Python on HackerRank 17 | * Few Chapters on Networking 18 | -------------------------------------------------------------------------------- /2019/deathwarden150/README.md: -------------------------------------------------------------------------------- 1 | # Anmol Srivastava 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/deepeshm41/README.md: -------------------------------------------------------------------------------- 1 | # Deepesh Menghani - Btech CSE 3rd yr JECRC University 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/dhruv-gupta14/README.md: -------------------------------------------------------------------------------- 1 | # Dhruv Gupta 2 | 3 | Hi, I am a sophomore pursuing my B.Tech in Electronics and Communication Engineering at The LNMIIT, Jaipur. 4 | 5 | I currently work in: 6 | 7 | * Full Stack Web Development 8 | * HTML,CSS,Javascript and Bootstrap for FrontEnd 9 | * Node.js in Backend 10 | * C++14 for competitive programming 11 | 12 | My Aim for the next 100 Days would be: 13 | 14 | * I intend to strengthen my knowledge of the languages I already am familiar with by building some good projects. 15 | 16 | * I would like to complete my full stack course including React and ReactNative and also a course based on algorithms. 17 | 18 | * I would also like to strengthen my competitive coding skills by practicing daily. 19 | ### Day 1 20 | 21 | 22 | ### Day 2 23 | 24 | 25 | ### Day 3 26 | 27 | I learnt two new Algorithms- KMP Algorithm and Levenshtein Distance Algorithm. 28 | 29 | I also completed my last assignment of a bootstrap 4 course. 30 | 31 | ### Day 4 32 | 33 | I solved two problems today provided in the telegram group. Submission of which can be found [here](https://leetcode.com/17uec044/). 34 | 35 | I learnt backtracking algorithm. 36 | 37 | I moved further on my algorithmic course. 38 | 39 | ### Day 5 40 | 41 | I moved further in my algorithmic course covering divide and conquer algorithms. 42 | 43 | Solved problem 1 of codechef long challenge and tried solving second. 44 | 45 | ### Day 6 46 | 47 | I solved a programming assignment of my algorithmic course. 48 | 49 | Solved problem 2 of codechef long challenge. 50 | 51 | ### Day 7 52 | 53 | Solved problem 3 of long challenge and practiced some questions on recursion. 54 | 55 | ### Day 8 56 | 57 | Solved some questions on recursion, tried solving question 4 of long challenge and solved 1 question on codeforces. 58 | Also solved no. of inversions problem by enhanced merge sort method. 59 | 60 | ### Day 9 61 | Solved problem 4 of long challenge and solved 2 question in codeforces. 62 | 63 | ### Day 10 64 | Took part in enigma coding competition and solved 2 questions. 65 | 66 | ### Day 11 67 | Studied about GraphQl and API's. 68 | Also moved further in my algorithmic course studying dynamic programming. 69 | 70 | ### Day 12 71 | Attended GraphQl meetup by Facebook Developer Circles, Jaipur and got to learn a lot about GraphQl Technology. 72 | 73 | ### Day 13 74 | Learnt a bit about dynamic programming and solved few questions on it. 75 | Also tried question 5 of long challenge. 76 | 77 | ### Day 14 78 | Completed my algorithmic course and got the certificate of completion by coursera. 79 | Also solved some questions based on arrays. 80 | 81 | ### Day 15 82 | Solved some questions on arrays. 83 | Revised some concepts of mongoDB, will continue it tomorrow. 84 | 85 | ### Day 16 86 | Studied concepts of server side development using express js, node js, mongoDB and RESTful routes. 87 | 88 | ### Day 17 89 | Studied 7 types of RESTful routes in detail. 90 | Also solved 2 questions on arrays. 91 | 92 | ### Day 18 93 | Studied Data Associations(embedded data) in Node Js. 94 | Also read Matlab output for Node Js(how to create a web app with Matlab). 95 | -------------------------------------------------------------------------------- /2019/divyaparwani/README.md: -------------------------------------------------------------------------------- 1 | # Divya Parwani 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/gargvaibhav64/README.md: -------------------------------------------------------------------------------- 1 | # Vaibhav Garg 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/gauravrock/Screenshot 2019-01-06 at 11.43.57 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/gauravrock/Screenshot 2019-01-06 at 11.43.57 PM.png -------------------------------------------------------------------------------- /2019/gauravrock/code datacamp/day9_basicpandas_code.py: -------------------------------------------------------------------------------- 1 | # Define count_entries() 2 | def counts_entries(df, col_name): 3 | """Return a dictionary with counts of 4 | occurrences as value for each key.""" 5 | 6 | # Initialize an empty dictionary: langs_count 7 | langs_count = {} 8 | 9 | # Extract column from DataFrame: col 10 | col = df[col_name] 11 | 12 | # Iterate over lang column in DataFrame 13 | for entry in col: 14 | 15 | # If the language is in langs_count, add 1 16 | if entry in langs_count.keys(): 17 | langs_count[entry]+=1 18 | # Else add the language to langs_count, set the value to 1 19 | else: 20 | langs_count[entry]=1 21 | 22 | # Return the langs_count dictionary 23 | return langs_count 24 | 25 | # Call count_entries(): result 26 | result=counts_entries(tweets_df,'lang') 27 | 28 | # Print the result 29 | print(result) 30 | -------------------------------------------------------------------------------- /2019/gauravrock/code datacamp/func_in_func.py: -------------------------------------------------------------------------------- 1 | # Define echo_shout() 2 | def echo_shout(word): 3 | """Change the value of a nonlocal variable""" 4 | 5 | # Concatenate word with itself: echo_word 6 | echo_word=word+word 7 | 8 | # Print echo_word 9 | print(echo_word) 10 | 11 | # Define inner function shout() 12 | def shout(): 13 | """Alter a variable in the enclosing scope""" 14 | # Use echo_word in nonlocal scope 15 | nonlocal echo_word 16 | 17 | # Change echo_word to echo_word concatenated with '!!!' 18 | echo_word = echo_word + "!!!" 19 | 20 | # Call function shout() 21 | shout() 22 | 23 | # Print echo_word 24 | print(echo_word) 25 | 26 | # Call function echo_shout() with argument 'hello' 27 | echo_shout('hello') 28 | -------------------------------------------------------------------------------- /2019/gauravrock/day9_code/project1/datasets/global_temperature.csv: -------------------------------------------------------------------------------- 1 | year,degrees_celsius 2 | 1850,7.74 3 | 1851,8.09 4 | 1852,7.97 5 | 1853,7.93 6 | 1854,8.19 7 | 1855,8.12 8 | 1856,7.9 9 | 1857,7.71 10 | 1858,8.13 11 | 1859,8.2 12 | 1860,7.78 13 | 1861,7.81 14 | 1862,7.49 15 | 1863,8.15 16 | 1864,7.94 17 | 1865,8.13 18 | 1866,8.19 19 | 1867,8.28 20 | 1868,8.09 21 | 1869,8.32 22 | 1870,8.08 23 | 1871,8.05 24 | 1872,8.12 25 | 1873,8.24 26 | 1874,8.38 27 | 1875,7.87 28 | 1876,7.99 29 | 1877,8.49 30 | 1878,8.78 31 | 1879,8.14 32 | 1880,8.06 33 | 1881,8.22 34 | 1882,8.1 35 | 1883,7.95 36 | 1884,7.77 37 | 1885,7.9 38 | 1886,7.9 39 | 1887,7.87 40 | 1888,8.06 41 | 1889,8.29 42 | 1890,7.95 43 | 1891,8.01 44 | 1892,8.05 45 | 1893,8.05 46 | 1894,8.15 47 | 1895,8.15 48 | 1896,8.22 49 | 1897,8.29 50 | 1898,8.19 51 | 1899,8.4 52 | 1900,8.5 53 | 1901,8.52 54 | 1902,8.28 55 | 1903,8.2 56 | 1904,8.08 57 | 1905,8.21 58 | 1906,8.38 59 | 1907,7.93 60 | 1908,8.16 61 | 1909,8.16 62 | 1910,8.21 63 | 1911,8.16 64 | 1912,8.15 65 | 1913,8.29 66 | 1914,8.58 67 | 1915,8.59 68 | 1916,8.23 69 | 1917,8.03 70 | 1918,8.13 71 | 1919,8.37 72 | 1920,8.34 73 | 1921,8.56 74 | 1922,8.4 75 | 1923,8.39 76 | 1924,8.48 77 | 1925,8.51 78 | 1926,8.72 79 | 1927,8.51 80 | 1928,8.62 81 | 1929,8.22 82 | 1930,8.6 83 | 1931,8.69 84 | 1932,8.69 85 | 1933,8.33 86 | 1934,8.63 87 | 1935,8.51 88 | 1936,8.54 89 | 1937,8.68 90 | 1938,8.86 91 | 1939,8.76 92 | 1940,8.77 93 | 1941,8.76 94 | 1942,8.72 95 | 1943,8.74 96 | 1944,8.83 97 | 1945,8.57 98 | 1946,8.67 99 | 1947,8.79 100 | 1948,8.74 101 | 1949,8.58 102 | 1950,8.36 103 | 1951,8.62 104 | 1952,8.64 105 | 1953,8.88 106 | 1954,8.56 107 | 1955,8.62 108 | 1956,8.28 109 | 1957,8.73 110 | 1958,8.78 111 | 1959,8.73 112 | 1960,8.58 113 | 1961,8.8 114 | 1962,8.75 115 | 1963,8.86 116 | 1964,8.41 117 | 1965,8.53 118 | 1966,8.61 119 | 1967,8.7 120 | 1968,8.51 121 | 1969,8.59 122 | 1970,8.71 123 | 1971,8.61 124 | 1972,8.51 125 | 1973,8.95 126 | 1974,8.47 127 | 1975,8.74 128 | 1976,8.35 129 | 1977,8.86 130 | 1978,8.7 131 | 1979,8.74 132 | 1980,8.98 133 | 1981,9.18 134 | 1982,8.65 135 | 1983,9.04 136 | 1984,8.7 137 | 1985,8.66 138 | 1986,8.84 139 | 1987,9.01 140 | 1988,9.21 141 | 1989,8.93 142 | 1990,9.25 143 | 1991,9.19 144 | 1992,8.84 145 | 1993,8.87 146 | 1994,9.04 147 | 1995,9.36 148 | 1996,9.04 149 | 1997,9.21 150 | 1998,9.53 151 | 1999,9.29 152 | 2000,9.2 153 | 2001,9.41 154 | 2002,9.56 155 | 2003,9.52 156 | 2004,9.32 157 | 2005,9.7 158 | 2006,9.52 159 | 2007,9.73 160 | 2008,9.42 161 | 2009,9.49 162 | 2010,9.7 163 | 2011,9.51 164 | 2012,9.5 165 | 2013,9.6 166 | 2014,9.56 167 | 2015,9.82 168 | 2016,10.02 169 | -------------------------------------------------------------------------------- /2019/gauravrock/read_books/Elementary Statistics A Step By Step Approach 9th ed Bluman.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/gauravrock/read_books/Elementary Statistics A Step By Step Approach 9th ed Bluman.pdf -------------------------------------------------------------------------------- /2019/gauravrock/read_books/Introduction_to_Probability_and_Statisti.pdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/gauravrock/read_books/Introduction_to_Probability_and_Statisti.pdf.pdf -------------------------------------------------------------------------------- /2019/gauravrock/read_books/thinkstats2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/gauravrock/read_books/thinkstats2.pdf -------------------------------------------------------------------------------- /2019/gdivya17/README.md: -------------------------------------------------------------------------------- 1 | # Divya Gupta 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/gopalsharma05/README.md: -------------------------------------------------------------------------------- 1 | ### Intro 2 | 3 | hello,i am gopal sharma ,prsuing b-tech in electronics and communication engineering from the LNM institute of information technology. 4 | I like to do competetive programming in c and cpp 14 and have good knowledge of HTML and CSS. 5 | I am here to improve the coding skills in data structure . 6 | 7 | ### DAY 1 8 | 9 | * Today i solve the first problem of the january challange of the codechef . 10 | 11 | ### DAY 2 12 | * solved the second problem of the january challange of the codechef. 13 | 14 | 15 | ### day 3 16 | * solved the third problem of the codechef january challange. 17 | 18 | ### day 4 19 | * solved the fifth problem of the codechef january challange. 20 | <<<<<<< HEAD 21 | ======= 22 | 23 | ### day 5 24 | * solved the 1st and 2nd problem of the Codeforces Round #534 (Div . 2). 25 | 26 | solution of 1st problem (Splitting into digits) is [here](https://ideone.com/uSpZ5n) 27 | 28 | solution of 2nd problem (Game with string) is [here](https://ideone.com/kqXhpA) 29 | 30 | 31 | ### day 6 32 | * solved the 1st problem of the Codeforces Round #518 (Div. 2) . 33 | 34 | solution is [here](https://ideone.com/SBCFxw) 35 | 36 | * solved the 3rd problem of the Codeforces Round #534 (Div . 2). 37 | 38 | solution is [here](https://ideone.com/AMNtJq) 39 | >>>>>>> 113c1780e56f4ed2a96ca6b82134f451f624feb8 40 | -------------------------------------------------------------------------------- /2019/gupta-here/README.md: -------------------------------------------------------------------------------- 1 | # Ranu Gupt 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/hiteshsubnani0128/Multiples of 3 and 5: -------------------------------------------------------------------------------- 1 | Project Euler #1: Multiples of 3 and 5 2 | def sum(n, k): 3 | d = n // k 4 | return k * (d * (d+1)) // 2 5 | 6 | def euler1(n): 7 | return sum(n, 3) + sum(n, 5) - sum(n, 15) 8 | 9 | t = int(input().strip()) 10 | for i in range(t): 11 | N = int(input().strip()) 12 | print(euler1(N - 1)) 13 | -------------------------------------------------------------------------------- /2019/hiteshsubnani0128/README.md: -------------------------------------------------------------------------------- 1 | # Hitesh Subnani 2 | 3 | ### Day 1 4 | Project Euler #1: Multiples of 3 and 5 5 | using Python 3 6 | 7 | 8 | ### Day 2 9 | 10 | 11 | ### Day 3 12 | -------------------------------------------------------------------------------- /2019/hrprt96/README.md: -------------------------------------------------------------------------------- 1 | # Harpreet Kaur 2 | ### Day 1 3 | 4 | 5 | ### Day 2 6 | 7 | 8 | ### Day 3 9 | -------------------------------------------------------------------------------- /2019/jains8844/README.md: -------------------------------------------------------------------------------- 1 | # Sarthak Jain 2 | #### I am First Year Student at IIT Indore in Computer Science Discipline. 3 | #### Currently I am learning Django Framework. 4 | #### Once I am done with this, I will be doing some projects based on it. 5 | #### This will be my contribution in #100DaysOfCode. 6 | #### Twitter Handle : @Sarthak02905076 7 | ## Day 1 : Learnt basic git commands. 8 | ## Day 2 : Learnt frontend technologies like HTML, Javascript and Jquery. 9 | ## Day 3 : Learnt Basic Django Framework including using templates, static files, models, models-templates-views etc. 10 | -------------------------------------------------------------------------------- /2019/jayeshchoubisa/README.md: -------------------------------------------------------------------------------- 1 | # Jayesh Choubisa 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/karangurtu/README.md: -------------------------------------------------------------------------------- 1 | # Karan Gurtu 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/kmalik31/README.md: -------------------------------------------------------------------------------- 1 | # Keshav Malik 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/luckyster895/README.md: -------------------------------------------------------------------------------- 1 | # Abhinav Saxena 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/may12day/README.md: -------------------------------------------------------------------------------- 1 | # Mayank Devnani 2 | 3 | * Pre-Final Year CSE 4 | * Machine Learning Intern at TensaX Innovation Lab 5 | 6 | Currently, I am working on respective fields mentioned below: 7 | - Machine Learning and its applications 8 | - Android Development using flutter 9 | 10 | You can contact me on various social media: 11 | - [Github](https://github.com/may12day) 12 | - [LinkedIn](https://www.linkedin.com/in/mayankdevnani/) 13 | - :mailbox: : maydev22@gmail.com 14 | 15 | ### Plans for 100DaysOfCode 16 | 17 | - Improving Algorithmic thinking 18 | - Solving some Kaggle Problems 19 | - Improving Python Skills 20 | 21 | ### Day 0 (Dec 31 2018) 22 | 23 | * Prepared My Introduction Here and Planning here. 24 | 25 | ### Day 1 (1 Jan 19) 26 | 27 | * Read Machine Learning articles on Medium 28 | * Creating Timer app in flutter 29 | 30 | ### Day 2 (2 Jan 19) 31 | 32 | * Read artices on Medium 33 | * Updated timer app in flutter 34 | * Working on Breast Cancer Classification project 35 | * Solved 2 simple problems in hackerrank 36 | 37 | ### Day 3 (3 Jan 19) 38 | 39 | * Created and updated repository of coding problems with solutions in java 40 | * Make bottom navigator bar in flutter and use firebase as back-end service 41 | * Read medium articles 42 | * Did problems in #CodeToExpress 100 days of challenge 43 | * Watched lectures on machine learning 44 | 45 | ### Day 4 (4 Jan 19) 46 | * Modified flutter app to requirements 47 | * Solved few python questions in one line 48 | 49 | ### Day 5 (5 Jan 19) 50 | * Attended Big Data bootcamp using DataBricks 51 | * Read blogs on linear regression 52 | 53 | ### Day 6 (6 Jan 19) 54 | * Finally created the base version of flutter app 55 | * Watched videos in udemy regarding React native 56 | 57 | ### Day 7 (7 Jan 19) 58 | * Made a local dataset by clicking images of faces 59 | * Read blog on optimizing linear regression model 60 | 61 | ### Day 8 (8 Jan 19) 62 | * Connecting firebase to flutter app 63 | * Read about google cloud platform and kubernetes 64 | 65 | ### Day 9 (9 Jan 19) 66 | * Few improvements in flutter app to have a sync with firebase 67 | * Watched videos in udemy of React native 68 | 69 | ### Day 10 (10 Jan 19) 70 | * Read blog on medium regarding machine learning applications and how to use effectively 71 | * Improving ML model to create a docker image to deploy on GCP -------------------------------------------------------------------------------- /2019/mithilesh-parmar/README.md: -------------------------------------------------------------------------------- 1 | # Mithilesh Parmar 2 | ### Day 1 3 | Started developing Windows 10 Simulator using javafx 4 | Implemented folder view and icons pane 5 | 6 | ### Day 2 7 | Implemented Taskbar and taskbar items 8 | Added some styling 9 | 10 | ### Day 3 11 | Added Peekview to task bar items to show file peek preview on hover 12 | -------------------------------------------------------------------------------- /2019/moulikcipherX/README.md: -------------------------------------------------------------------------------- 1 | # Moulik Aggarwal 2 | 3 | Hi, I am a pre-final year student, pursuing B.Tech from Amity University Rajasthan. 4 | 5 | Currently, I am working on various fields: 6 | - Competitive Programming in C++ 7 | - Web Development using NodeJS 8 | - Python for DevOps (Just a Hobby) :wink: 9 | 10 | What I want to work on next? 11 | - Cloud Computing 12 | - Data Science 13 | - Facebook Developer Circles Training 14 | - January '19 to December '19 15 | - Daily LeetCode Questions 16 | 17 | You can contact me on various social media: 18 | - [Github](https://www.github.com/moulikcipherx) 19 | - [LinkedIn](https://www.linkedin.com/in/moulik-aggarwal-5a499480/) 20 | - :mailbox: : qwertymoulik@gmail.com 21 | 22 | ### Day 1 23 | 24 | Solved LeetCode Questions 25 | - Hamming Distance 26 | [Solution](https://github.com/moulikcipherX/LeetCode) 27 | 28 | ### Day 2 29 | 30 | 31 | ### Day 3 32 | -------------------------------------------------------------------------------- /2019/mr-sharmaji/README.md: -------------------------------------------------------------------------------- 1 | # Subham Sharma 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/n0obs73r/README.md: -------------------------------------------------------------------------------- 1 | # Aryan Dadheech 2 | Hoi, I'm Aryan Dadheech. Currently pursuing Btech from JECRC University,Jaipur. 3 | 4 | I've done some projects on IOT. I was into AI and Machine learning but after knowing the requirements just to get started with it were a nightmare for me. So for now, I've backed-up and been searching and scratching the surfaces different fields just to get the taste of everything. Yeah, I'm an explorer too :v . You can call me a noob, Well that's what my username say ¯\_(ツ)_/¯ but i do have a passion for learning new stuff. 5 | 6 | As a fresher i don't have a working experience, but i do have the will to learn. 7 | In this upcoming time, taking #100DaysofCode as a challenge i'd be learning about android develpoment and language C++. And I've rolled into a Machine learning course as well just to have an idea about how things work around in advance alogs :') 8 | 9 | # Happy Coding 10 | 11 | ### Day 1 12 | Today I learned about overall model process of supervised and unsupervised learning 13 | later following to linear regression and some examples. Also I've been tracking progress 14 | of my friend @DeadVampire aka Alucard about Binary trees and linked lists :3 . 15 | 16 | > Also on the android development side :- 17 | 18 | - [x] Started with kotlin. 19 | - [x] Understanding the basic layout of App. 20 | - [x] Creating Resources with strings. 21 | - [x] More about constraints. 22 | - [ ] Made an interactive App. 23 | 24 | ### Day 2 25 | 26 | > In Machine Learning :- 27 | - Progress in Model Representation and Cost Function - Intuition. 28 | - Interacting with GNU octave interpreter. 29 | - Came across a few problems of systems of equations with linear algebra operations on vectors and matrices.(Although i didn't solved any, I was just understanding the way of solving them). 30 | 31 | > Android Development :- 32 | 33 | - Getting started with flutter as it was pretty user friendly and is now treanding for app development. 34 | 35 | ### Day 3 36 | -------------------------------------------------------------------------------- /2019/nikhiljain/Read Me.md: -------------------------------------------------------------------------------- 1 | # Nikhil Jain 2 | 3 | I am a First Year IT student at Manipal University Jaipur.I am currently learning Python from Udemy. By the end of these 100 days I will try to complete my ongoing Python Course and a project in Django(A Blog Application) as well as in Tkinter 4 | 5 | ### Day 1 6 | 7 | Today I started my day by making a Rock Paper Scissor game then I moved forward in my Python Course learning List and List Comprehensions and practised it and I also started Hackerank and solved some easy problems on it. 8 | 9 | ### Day 2 10 | 11 | Today I learned basics of Dictionary and some methods related to it and I continued solving problems on HackerRank as well as started solving problems on Leetcode also. 12 | 13 | ### Day 3 14 | 15 | Today I started Harvard CS50 in which I learned basics of C then I solved problems on HackerRank. 16 | 17 | ### Day 4 18 | 19 | Today I learned Basics of Dictionary in Python and solved Problem Set 1 of Harvard CS50. 20 | 21 | ### Day 5 22 | 23 | Today I moved forward in my Python Course and learned more about Dictionary and methods related to it. 24 | 25 | ### Day 6 26 | 27 | Today I solved many problems related to Dictionary in Python. Started 2nd Lecture of Harvard CS50. I realise I enjoy coding in C more because it just seems like I am giving instruction to Computer Directly whereas in Python It seems like I am talking to just another person.Though I am very newbie to make any comparison between Python and C (But still just a thought). 28 | 29 | ### Day 7 30 | 31 | Today I created a data model of a spotify playlist. Made a program which save playlist for different user allowing them to update their paylist and I am thinking to update this program further more.Then I solved some problems on HackerRank. 32 | 33 | ### Day 8 and 9 34 | 35 | In these two days I completed quite a few problems on HackerRank.Now I feel quite confident with Dictonaries and List Data Structures in Python.Now in coming days I will look forward to continue my Python Course will try to complete it as soon as possible. 36 | 37 | ### Day 10 38 | 39 | Today was a hectic day came back from college at 5pm .Then I decided to take break from my regular python course and learn Web Scrapping from "Automate The Boring Stuff".I completed the lesson and created a Python Script to fetch me live cricket score from Crickbuzz website.Though I also wanted to make a notification pop up to appear on my desktop using notify2 module.I was not succesfull in doing it will try it any other day though. 40 | 41 | ### Day 11 42 | 43 | Today I moved forward in my Python Course and learnt Tuple and Sets and started functions basic and learnt Function Calls and Stack got to know about Call Frame and Run Time Stack. 44 | 45 | ### Day 12,13 and 14 46 | 47 | In these three days I completed CS50 second lecture and moved forward in my Python Course to learn more about Functions. 48 | 49 | ### Day 15 50 | 51 | Today was a super unproductive day but still managed to move forward in Python Course and revised some previous concepts of Python. 52 | 53 | ### Day 16 54 | 55 | Today I solved 3 problems on SPOJ and moved forward in my Python Course to learn more about functions. 56 | 57 | ### Day 17 58 | 59 | Moved forward in my Python Course learn more about Function. Functions which can take arguments and How does "return" works. 60 | 61 | ### Day 18 62 | 63 | Took a break from Python course and completed Harvard CS50 2nd lecture. 64 | 65 | ### Day 19 66 | 67 | Moved forward in my Python Course and learnt How to set a default parameters in a function , Common mistakes while returning ,Keywords Arguments and Scope. 68 | 69 | ### Note :- I was not able to do much on 20 January and 21 January because I was travelling to my hometown will make up for this on this weekend. 70 | 71 | ### Day 20 72 | 73 | Today I moved forward in my Python Course.Created many function to get better understanding of functions in Python. 74 | 75 | ### Day 21 76 | 77 | Today I revisted all the topics I have lerant so far in Python and also created a function to check if a word in palindrome or not. 78 | 79 | ### Day 22 80 | 81 | Today I completed section 1 of Function in my Python Course. 82 | 83 | ### Day 23 84 | 85 | Today I completed section 2 of Function in my Python Course. 86 | 87 | ### Day 24 88 | 89 | Today I completed PSET 2 of Harvard CS50 by David Malan. 90 | 91 | ### Day 25 92 | 93 | Today I learnt Lambda Function and built in function in Python. 94 | 95 | ### Day 26 96 | 97 | Today I started Lecture 3 of Harvard CS50. 98 | 99 | ### Day 27 100 | 101 | Today I completed Lecture 3 of Harvard CS50. 102 | 103 | ### Day 28 104 | 105 | Today I learnt Error Handling and Debugging. 106 | 107 | ### Day 29-33 108 | 109 | In these days I moved forward in my Python Course and started learning Object Oriented Programming and I also learnt to make HTTP request using Python.Mainly I focused on learning C from Let Us C book as my exams are also coming. 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /2019/piyushagarwal08/README.md: -------------------------------------------------------------------------------- 1 | # Piyush Agarwal 2 | on the beginnning of this new year i take the oath to complete this challenge and currently i am a 2nd year cse student finished with 3rd sem and i am learning python through courses over coursera. 3 | i have knowledge for python basics, data structure, web accessing with python, in progress to learn working over sql using python. 4 | i am workaholic able to move forward when i have a goal. 5 | 6 | ### Day 1 7 | it was a great day in regards more to learning less to actual coding. 8 | i learned abour open source software , actually finished up my learning course over coursera by which i learned about various licenses available and how one is supposed to work in an OSS project. 9 | further in python , i studied about working with base. due i only finished with understanding the basic structure of it and difference between a DATABASE ADMINISTRATOR and SOFTWARE DEVELOPER and bit of exposure to use of sqllite. 10 | i have decided to continue my work on sqllite from tomorrow. 11 | in terms of code, created a simple code to find if certain array contains similar elements (contains_duplicate.py). 12 | 13 | ### Day 2 14 | not much just studied some basic query language that can be used over sqllite. 15 | creating tables, adding or deleting data or updating it. 16 | 17 | ### Day 3 18 | working over web scrapping program, still unable to resolve the issues. 19 | trying to scrap data from a webpage. 20 | 21 | ### Day 4 22 | couldn't get time today for coding but still tried to learn and understand the concept of database design and modelling felt somewhat similar to dfd. 23 | 24 | ### Day 5 25 | created a program to calculate the number of similar domains present in a text file using database language that is sql and python. 26 | helped me learn how to use a database(basic). 27 | 28 | ### Day 6 29 | Created a prpgram to extract text from a webpage and save it in a text file using Request and BeautifulSoup libraray. 30 | 31 | ### Day 7 32 | Learned new term Happy numbers and unhappy numbers. 33 | Tried to create a program to find happy numbers in a certain range(not completed) 34 | 35 | ### Day 8 36 | 37 | 38 | ### Day 9 39 | 1. Learned how to crack a computer password without using any external software or drive. 40 | 2. Tried to understand use of API 41 | 42 | ### Day 10 43 | Learned about relational database design and modelling 44 | -------------------------------------------------------------------------------- /2019/piyushagarwal08/contains_duplicate.py: -------------------------------------------------------------------------------- 1 | duplicate = eval(input("enter your array within []")) 2 | duplicate.sort() 3 | i = 0 4 | while i < (len(duplicate)-1): 5 | if duplicate[i] == duplicate[i+1]: 6 | print("true") 7 | break 8 | i = i+1 9 | if i == (len(duplicate) - 1): 10 | print("false") 11 | 12 | -------------------------------------------------------------------------------- /2019/prashant0598/README.md: -------------------------------------------------------------------------------- 1 | # Prashant Nigam 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/prayas26/README.md: -------------------------------------------------------------------------------- 1 | # Prayas Mittal 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/premanshupareek/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | My name is Premanshu Pareek. I am Computer Science and Engineering graduate from the 2018 batch. I have a keen interest in AI and ML and I am always working on improving my skills in this area. The thought of the impact that AI can have in the future really inspires me. On the other hand, I am also a web developer and continuously working on getting better at it. I have also written some blogs for OpenSense Lab about Drupal and relevant technologies that you can read about [here](https://opensenselabs.com/user/premanshu). 4 | 5 | ## Day 0 6 | 1. Commited to the 100DaysofCode challenge on [Twitter](https://twitter.com/PremanshuPareek/status/1079816413714337793) 7 | 2. Completed Basic HTML and Basic CSS modules on FreeCodeCamp 8 | 9 | ## Day 1 10 | 1. Decided on the 1st project - Item Catalog 11 | 2. Project Description 12 | * An application that provides a list of items within a variety of categories as well as provide a user registration and authentication system 13 | * Registered users will have the ability to post, edit and delete their own items 14 | 3. Topics Covered 15 | * Developing RESTful web appication using the Python framework Flask 16 | * Implementing third party OAuth authentication 17 | * Proper use of various HTTP methods 18 | * Implementing CRUD functionality to the website 19 | 20 | ## Day 2 21 | 1. Started the work on the Project - Item Catalog 22 | 2. Created the database schema for the app 23 | 3. Learned and used the SQLAlchemy to setup the database 24 | 4. Created the mockups/designs for the website 25 | 5. Completed Applied Visual Design module on FreeCodeCamp 26 | 27 | ## Day 3 28 | 1. Read the Flask documentation 29 | 2. Created the HTML templates for the website pages 30 | 31 | ## Day 4 32 | 1. Created a local server using Python that handles the HTTP requests for the app 33 | 2. Implemented the Read functionality - the app now fetches the data from the database and displays it 34 | 35 | ## Day 5 36 | 1. Added Create, Update and Delete functionality 37 | 2. Completed Intro to JavaScript course on Udacity 38 | 3. Started a Course on Udemy - JavaScript Algorithms and Data Structures Masterclass by Colt Steele 39 | 40 | ## Day 6 41 | 1. Completed Section 2 and 3 from Udemy course 42 | 2. Practiced JavaScript algorithms from course 43 | 44 | ## Day 7 45 | 1. Learned about OAuth 46 | 2. Created third-party sign for the web application using Google's authentication services 47 | 48 | ## Day 8 49 | 1. Learned about Local Permission System - It protects pages based on each user and just whether the user is logged in 50 | 2. Started Section 4 from the Udemy JS course 51 | 52 | ## Day 9 53 | 1. Finished Section 4 of the Udemy JS course 54 | 2. Added Styles to the Web App 55 | 56 | ## Day 10 57 | 1. Took a break from Working on the project and Revised some basic algorithms and data structures 58 | 59 | ## Day 11 60 | 1. Learned about the APIs 61 | 2. Worked on implementing a JSON endpoint that serves the same information as displayed in the HTML endpoints for an item in the catalog 62 | 63 | ## Day 12 64 | 1. Worked on making the web app responsive 65 | 2. Started the section 5 of the Udemy JS course 66 | 67 | ## Day 13 68 | 1. Completed the Section 5 and 6 of Udemy JS course 69 | -------------------------------------------------------------------------------- /2019/ravigupta/README.md: -------------------------------------------------------------------------------- 1 | # Ravi Gupta 2 | ### Day 1 3 | 4 | 5 | ### Day 2 6 | 7 | 8 | ### Day 3 9 | -------------------------------------------------------------------------------- /2019/rishabhkalakoti/README.md: -------------------------------------------------------------------------------- 1 |

Rishabh Kalakoti

2 |

3 | CSE, MNIT Jaipur 4 |
5 | Learner :) 6 |

7 | 8 | # TODOs 9 | **Readings** 10 | - [ ] C++ (Balaguruswamy) 11 | - [ ] A Programmer's Guide to JAVA SCJP certification (Khalid Mughal) 12 | - [ ] TCP-IP Illustrated: The Protocol, (Richard, Sievens) 13 | - [ ] Operating Systems: Three easy pieces (Remzi) 14 | 15 | **Courses** 16 | - [ ] Machine Learning, Stanford, Coursera 17 | - [ ] Software Security, Maryland, Coursera 18 | 19 | # The Timeline... 20 | 201 | 202 | As the challenge has officially ended (Yeah. I started late) I reduced my version of 100DaysOfCode to 30DaysOfCode. 203 | It was a great initiative and has helped me introspect and improve. Thanks for the support :) 204 | 205 | So I therefore end my #30DaysOfCode 206 | -------------------------------------------------------------------------------- /2019/ritik619/README.md: -------------------------------------------------------------------------------- 1 | # Ritvij Srivastava 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/ritikmahesh/README.md: -------------------------------------------------------------------------------- 1 | # Ritik Maheshwari 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/rustagishubhi/README.md: -------------------------------------------------------------------------------- 1 | # Shubhi Rustagi 2 | 3 | I am a sophomore B.Tech CSE. 4 | 5 | I am a Front-End Developer. Currently I am learning Backend Development in Python. 6 | 7 | I know the following languages:- 8 | ** C++ ** 9 | ** Java ** 10 | ** Python ** (recently learned) 11 | ** Javascript ** for frontend development. 12 | 13 | I have novice knowledge about: 14 | ** NodeJS ** 15 | ** Express ** 16 | ** MongoDB ** 17 | 18 | ## Day 1 19 | 20 | - Worked on styling a webpage. 21 | 22 | ## Day 2 23 | 24 | - Worked on the submission page of PyJudge. 25 | - Read articles on User Authentication using Django. 26 | - Read articles on Handlebars and Express. 27 | -------------------------------------------------------------------------------- /2019/sahushivam713/README.md: -------------------------------------------------------------------------------- 1 | # Shivam Sahu 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/sakshipareek/README.md: -------------------------------------------------------------------------------- 1 | # Sakshi Pareek 2 | #### I am a btech(CSE) student and intreseted in cyber security mainly, and currently i have started by completing C language and so I will use #100daysofcode to learn and practice it daily even if only for an hour or two. 3 | ### my goals for these 100 days 4 | #### 1)complete C programming 5 | #### 2)complete networking concepts 6 | #### 3)start python 7 | #### 4)learn more of hardware hacking 8 | ### Day 1 9 | ##### Today i practiced functions in C , recursion and arrays. 10 | ### Day 2 11 | ##### Did'nt do much today,just revised kali linux by practising some tools,google dork commands,aircrack and footprinting. 12 | ### Day 3 13 | ##### today i did scan enumeration,TCP handshake, OS fingerprinting ,mapping networks,system hacking,backdoor system hacking,malware viuses,malware hash calc, and subnet mask,perimeter networks or DMZs, CSMA/CD,client/sever and peer to peer model, OSI model and its layers. 14 | ### Day 4 15 | ##### today i did sniffing using wireshark and ettercap,social engineering and session hijacking also i learned in detail about 7 layers in OSI model and TCP/IP model and i did some more programs using array. 16 | ### Day 5 17 | ##### today i did SQL injection and mobile hacking using arch jailbreak and tried to find some bug in airtable site from bug bounty programs. 18 | ### Day 6 19 | ##### Did 5-6 problems on codechef of C. 20 | ### Day 7-10 21 | ##### my C is almost complete but in the upcomming week i will practice some more problems and i have only 2 more topics left in the penetration testing and my networking conecepts are complete. 22 | 23 | -------------------------------------------------------------------------------- /2019/sanjeevbrin/README.md: -------------------------------------------------------------------------------- 1 | # Sanjeev Kumar 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/shivank98/LeetCodeSolution/LongestCommanPrefix.py: -------------------------------------------------------------------------------- 1 | class Solution: 2 | 3 | def if_all_prefix(self, strs, n, small_world, low, mid): 4 | 5 | for i in range(len(n)): 6 | str_1 = strs[i] 7 | for j in range(len(low, mid+1)): 8 | if str_1[j] != small_world[j]: 9 | return False 10 | return True 11 | 12 | def longestCommonPrefix(self, strs): 13 | def if_all_prefix(strs, n, small_world, low, mid): 14 | 15 | for i in range(n): 16 | str_1 = strs[i] 17 | for j in range(low, mid+1): 18 | if str_1[j] != small_world[j]: 19 | return False 20 | return True 21 | """ 22 | :type strs: List[str] 23 | :rtype: str 24 | """ 25 | result = "" 26 | if len(strs) != 0: 27 | l = len(min(strs, key = len)) 28 | 29 | else: 30 | return result 31 | 32 | low = 0 33 | high = l-1 34 | 35 | while low <= high: 36 | mid = low + (high - low) // 2 37 | if (if_all_prefix(strs, len(strs), strs[0], low, mid)): 38 | result += strs[0][low:mid+1] 39 | low = mid +1 40 | else: 41 | high = mid -1 42 | return result 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /2019/shivank98/LeetCodeSolution/RemoveDuplicatesfromSorted.py: -------------------------------------------------------------------------------- 1 | class Solution: 2 | def removeDuplicates(self, nums): 3 | """ 4 | :type nums: List[int] 5 | :rtype: int 6 | """ 7 | index = 0 8 | prev_index = None 9 | for i in nums: 10 | if i != prev_index: 11 | nums[index] = i 12 | index+=1 13 | prev_index = i 14 | 15 | 16 | return index 17 | 18 | 19 | # Problem Link: https://leetcode.com/problems/remove-duplicates-from-sorted-array/ 20 | -------------------------------------------------------------------------------- /2019/soumilk/1.Two Sum.md: -------------------------------------------------------------------------------- 1 | ``` 2 | class Solution: 3 | def twoSum(self, nums, target): 4 | temp=target 5 | for i in range(0,len(nums)-1): 6 | temp=temp-nums[i] 7 | for j in range(i+1,len(nums)): 8 | if nums[j]==temp: 9 | return [i,j] 10 | temp=target 11 | ``` 12 | 13 | -------------------------------------------------------------------------------- /2019/soumilk/217.Contains Duplicate.md: -------------------------------------------------------------------------------- 1 | 2 | ## This is a naive approach and will give a 'Time limit exceed' result. 3 | ``` 4 | class Solution { 5 | public: 6 | bool containsDuplicate(vector& nums) { 7 | for(int i=0;i 24 | class Solution { 25 | public: 26 | bool containsDuplicate(vector &nums) { 27 | 28 | sort(nums.begin(),nums.end()); 29 | 30 | for(int i=1;i container_name 2 | 3 | ``` 4 | class Solution { 5 | public: 6 | bool containsNearbyDuplicate(vector& nums, int k) { 7 | unordered_mapumap; // Step 1 8 | for(int i=0;i 22 | * Step 1: We created a new container which is basically a key and a value pair container.
23 | * Step 2: After we entered in the loop, we initialised the pair with the value 'i+1', the reason behind setting it 'i' instead of 'i+1' is stated in the next step.
24 | * Step 3: Now, whenever we come across a key value of vector 'nums' which is already present in the container, we make a check and now remember we set up the value of key to i+1, this is because for the very first element of the vector the value of 'i' is zero, now because of this the value of expression at Step 3- would be -> 'umap[nums[i]]=0', which is false and our 'IF' statement would never execute for the 0th element of the vector. Therefore we set it as 'i+1'.
25 | * Step 4: As we added an extra value to 'i' so we will subtract 1 in the condition and check it for the validity of our condition with respect to k. 26 | -------------------------------------------------------------------------------- /2019/soumilk/7.Reverse Integer.md: -------------------------------------------------------------------------------- 1 | 2 | Logic is really simple, the only thing to note in this problem is to check if the reverse number is under the bounds, if not, then 3 | just return zero. 4 |

5 | ``` 6 | class Solution: 7 | def reverse(self, x): 8 | s=str(x) 9 | if x<0: 10 | s=s[:0:-1] 11 | s=0-int(s) 12 | if (s> 2**31 or s<= -2**31): 13 | return 0 14 | return s 15 | s=s[::-1] 16 | s=int(s) 17 | if (s> 2**31 or s<= -2**31): 18 | return 0 19 | return s 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /2019/soumilk/Explanation of fast exponentiation.md: -------------------------------------------------------------------------------- 1 | ## Fast exponentiation : 2 | usually in competitions, we need to calculate the large exponential powers of the numbers and we need to find out the values.
3 | To calculate the exponentials of a given number, the naive approach is to simple run the loop and multiply the digit exponent times
4 | ### Code example of naive approach ( O(n) ):
5 | this algo will take the time propotional to the exponent number. In most of the coding contests, this approach to find out the exponential
6 | will give a TLE (time limit exceed). 7 | ``` 8 | def exponent(a,n): 9 | ans=1 10 | if n==0: 11 | return 1 12 | elif n==1: 13 | return a 14 | for i in range(0,n): 15 | ans=ans*a 16 | return ans 17 | ``` 18 | Now we will discuss the better and the fast approach to get the exponent of the number. 19 | ### Code example of fast approach ( O(log n) ):
20 | This is the fast and a better way to find out the exponentials of the number, it basically keeps slicing the exponent by half till
21 | it becomes 1 or 0. 22 | 23 | ``` 24 | def exponent1(a,n): 25 | if n==0: 26 | return 1 27 | elif n==1: 28 | return a 29 | else: 30 | r=exponent1(a,n//2) 31 | if n%2==0: 32 | return r*r 33 | else: 34 | return r*a*r 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /2019/soumilk/Fast Exponentiation.py: -------------------------------------------------------------------------------- 1 | 2 | # Naive approach O(n) 3 | def exponent(a,n): 4 | ans=1 5 | if n==0: 6 | return 1 7 | elif n==1: 8 | return a 9 | for i in range(0,n): 10 | ans=ans*a 11 | return ans 12 | 13 | # fast exponentation O(log n) 14 | def exponent1(a,n): 15 | if n==0: 16 | return 1 17 | elif n==1: 18 | return a 19 | else: 20 | r=exponent1(a,n//2) 21 | if n%2==0: 22 | return r*r 23 | else: 24 | return r*a*r 25 | 26 | a=int(input("Enter the number ")) 27 | n=int(input("Enter the exponent ")) 28 | s1=exponent(a,n) 29 | s=exponent1(a,n) 30 | print(s1) 31 | print(s) 32 | 33 | -------------------------------------------------------------------------------- /2019/soumilk/February Cook-Off 2019/Buying New Tablet.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(0,n): 3 | num,bug=map(int,input().split()) 4 | resultant=[] 5 | flag=0 6 | for j in range(0,num): 7 | w,h,p=map(int,input().split()) 8 | resultant.append([w*h,p]) 9 | resultant.sort(reverse=True) 10 | for k in resultant: 11 | if k[1]<=bug: 12 | print(k[0]) 13 | flag=1 14 | break 15 | if flag==0: 16 | print("no tablet") 17 | 18 | #resultant.sort(reverse=True) 19 | #print(resultant) 20 | -------------------------------------------------------------------------------- /2019/soumilk/February Cook-Off 2019/Chef and Party.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range(0,n): 3 | arr=[] 4 | num=int(input()) 5 | arr=list(map(int,input().split())) 6 | arr.sort() 7 | print(arr) 8 | count=0 9 | for j in range(0,len(arr)): 10 | if arr[j]==0: 11 | count+=1 12 | continue 13 | if count>=arr[j]: 14 | count+=1 15 | print(count) 16 | print(count) 17 | 18 | -------------------------------------------------------------------------------- /2019/soumilk/February Cook-Off 2019/Max Range Queries.py: -------------------------------------------------------------------------------- 1 | n=int(input()) 2 | for i in range (0,n): 3 | n,k=map(int,input().split()) 4 | l=[] 5 | for j in range(0,n): 6 | left,right=map(int,input().split()) 7 | l.append([left,right]) 8 | count=0 9 | for k in range(0,len(l)-1): 10 | for u in range(k+1,len(l)): 11 | x=min(l[k][1],l[u][1]) 12 | xx=max(l[k][0],l[u][0]) 13 | diff=x-xx+1 14 | if diff>count: 15 | count=diff 16 | print(count) 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /2019/soumilk/February Cook-Off 2019/Questions link.md: -------------------------------------------------------------------------------- 1 | This is the link to the Questions :
2 | [Questions](https://www.codechef.com/COOK103B?order=desc&sortBy=successful_submissions) 3 | 4 | Successfully solved question :
5 | [Buying New Tablet](https://www.codechef.com/COOK103B/problems/TABLET)
6 | [Chef and Party](https://www.codechef.com/COOK103B/problems/CHFPARTY)
7 | [Max Range Queries](https://www.codechef.com/COOK103B/problems/MAXREMOV)
8 | -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-1 Path in Trees/1path in trees.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-1 Path in Trees/1path in trees.jpeg -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-1 Path in Trees/path in trees continued.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-1 Path in Trees/path in trees continued.jpeg -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-1 Path in Trees/solution Trees.py: -------------------------------------------------------------------------------- 1 | class Node: 2 | def __init__(self,key): 3 | self.left = None 4 | self.right = None 5 | self.val = key 6 | 7 | n,k=[int(x) for x in input().split()] 8 | 9 | d={} 10 | 11 | path=[0]*(int(n)+1) 12 | sum1=0 13 | sum2=0 14 | 15 | root,first=[int(x) for x in input().split()] 16 | d["a"+str(root)]=Node(root) 17 | d["a"+str(first)]=Node(first) 18 | if(d["a"+str(root)].left==None): 19 | d["a"+str(root)].left=d["a"+str(first)] 20 | else: 21 | d["a"+str(root)].right=d["a"+str(first)] 22 | 23 | 24 | for i in range(int(n)-2): 25 | f,g=[int(x) for x in input().split()] 26 | d["a"+str(g)]=Node(g) 27 | if(d["a"+str(f)].left==None): 28 | d["a"+str(f)].left=d["a"+str(g)] 29 | else: 30 | d["a"+str(f)].right=d["a"+str(g)] 31 | 32 | def Inorder(node): 33 | global sum2 34 | if node: 35 | sum2+=1 36 | Inorder(node.left) 37 | Inorder(node.right) 38 | return sum2 39 | 40 | for i in range(int(k),int(n)+1): 41 | sum2=0 42 | path[i]=Inorder(d["a"+str(i)])-1 43 | sum1+=path[i] 44 | 45 | print(sum1) 46 | -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-2 Array Construction/1array construction.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-2 Array Construction/1array construction.jpeg -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-2 Array Construction/array construction continued.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-2 Array Construction/array construction continued.jpeg -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-2 Array Construction/prefix sum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from math import sqrt 4 | 5 | n=int(input()) 6 | 7 | a=[] 8 | a.append(1) 9 | flag=0 10 | sum=1 11 | for i in range(n-1): 12 | b=sqrt(sum) 13 | c=(b+1)*(b+1) 14 | if(int(c-sum)<=1000000): 15 | a.append(int(c-sum)) 16 | sum+=a[i+1] 17 | else: 18 | flag=1 19 | 20 | if(flag==1): 21 | print(-1) 22 | else: 23 | for i in a: 24 | print(i,end=" ") 25 | -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-3 Similarity of Strings/1similarity of strings .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-3 Similarity of Strings/1similarity of strings .png -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-3 Similarity of Strings/similariy os strings continued.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/HackerEarth Engineering Intern Challenge/Q-3 Similarity of Strings/similariy os strings continued.png -------------------------------------------------------------------------------- /2019/soumilk/HackerEarth Engineering Intern Challenge/Q-3 Similarity of Strings/strings.py: -------------------------------------------------------------------------------- 1 | t=int(input()) 2 | for y in range(0,t): 3 | s=input() 4 | sub=input() 5 | start=[] 6 | x=s.count(sub[0]) 7 | start.append(s.find(sub[0])) 8 | #print(start,x) 9 | count=[] 10 | j=1 11 | f=0 12 | k=1 13 | if sub in s: 14 | print("Yes") 15 | print(0) 16 | continue 17 | else: 18 | for i in range(0,x): 19 | for j in range(start[i]+1,len(s)): 20 | #print("j ",j, " k ",k) 21 | if k>=len(sub): 22 | break 23 | if s[j]==sub[k]: 24 | k+=1 25 | continue 26 | if s[j]!=sub[k]: 27 | f+=1 28 | continue 29 | 30 | if len(s)-start[i]>=len(sub) and k>=len(sub): 31 | count.append(f) 32 | f=0 33 | k=1 34 | #print("count " ,count) 35 | start.append(s.find(sub[0],start[i]+1)) 36 | 37 | count.sort() 38 | if len(count)==0: 39 | print("No") 40 | else: 41 | print("Yes") 42 | print(count[0]) 43 | -------------------------------------------------------------------------------- /2019/soumilk/Hashing with collision.py: -------------------------------------------------------------------------------- 1 | def hash_function(x): 2 | return x%10 3 | def insert(hash_table,x,s): 4 | key=hash_function(x) 5 | hash_table[key].append(s) 6 | 7 | hash_table=[[] for i in range (10)] 8 | print(hash_table) 9 | insert(hash_table,19,"USA") 10 | insert(hash_table,55,"India") 11 | insert(hash_table,78,"Canada") 12 | insert(hash_table,52,"Japan") 13 | insert(hash_table,19,"russia") 14 | insert(hash_table,55,"china") 15 | insert(hash_table,78,"swedan") 16 | insert(hash_table,52,"brazil") 17 | print(hash_table) 18 | 19 | if 'Japan' in hash_table[2]: 20 | print('found') 21 | print(hash_table[2]) 22 | 23 | #output: 24 | #[[], [], [], [], [], [], [], [], [], []] 25 | #[[], [], ['Japan', 'brazil'], [], [], 26 | # ['India', 'china'], [], [], ['Canada', 'swedan'], 27 | # ['USA', 'russia']] 28 | -------------------------------------------------------------------------------- /2019/soumilk/Internship Screening Test/Airavath-1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | class fight // Class which includes the details about the fighers 10 | { 11 | private: // private data types of class 12 | float h_thanos=0,h_bahu=0,att_thanos_time=0,att_bahu_time=0; 13 | float t=0; 14 | float loss_thanos=0,loss_bahu=0; 15 | int attack_no=0; 16 | public: 17 | fight() // default constructor 18 | { 19 | cout<<"Enter the health of thanos and bhaubhali, either same or maximum difference of 5%"<>h_thanos>>h_bahu; 21 | } 22 | void display() // To display the present status of both fighters 23 | { 24 | cout<<"health of bahu "<5) 40 | { 41 | cout<<"You havnt entered the valid input, please enter the valid inputs of health of both fighters"<>h_thanos>>h_bahu; 43 | ma=max(h_thanos,h_bahu); 44 | mi=min(h_thanos,h_bahu); 45 | } 46 | loss_thanos=h_thanos*(0.10); // amount of damage thanos receive from bahubali 47 | loss_bahu= h_bahu*(0.15); // amount of damage bahubali receives from Thanos 48 | } 49 | void fight::tattack() 50 | { 51 | cout<<"***********THIS IS FOR GOOD**************"<0.1 && h_thanos>0.1) 72 | { 73 | if (t==att_thanos_time) 74 | { 75 | tattack(); 76 | } 77 | if (t==att_bahu_time) 78 | { 79 | battack(); 80 | } 81 | t+=0.5; // Increasing time by 0.5 seconds 82 | } 83 | if (h_bahu>0) 84 | return "Bahubhali wins"; 85 | 86 | return "Thanos wins"; 87 | } 88 | int main() 89 | { 90 | fight f; 91 | f.checkinputs(); 92 | srand (time(NULL)); // to generate a seed for the random values 93 | cout<<"At t=0"< 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | class fight 10 | { 11 | private: 12 | float h_thanos=0,h_bahu=0,att_thanos_time=0,att_bahu_time=0; 13 | float t=0; 14 | float dup_thanos=0,dup_bahu=0; // to store the values of the health initially (useful in calculating 61.5% factor) 15 | int attack_no=0,b_attack_no=0,t_attack_no=0; 16 | public: 17 | fight() 18 | { 19 | cout<<"Enter the health of thanos and bhaubhali, either same or maximum difference of 5%"<>h_thanos>>h_bahu; 21 | } 22 | void display() 23 | { 24 | cout<<"health of bahu "<5) 40 | { 41 | cout<<"You havnt entered the valid input, please enter the valid inputs of health of both fighters"<>h_thanos>>h_bahu; 43 | ma=max(h_thanos,h_bahu); 44 | mi=min(h_thanos,h_bahu); 45 | } 46 | dup_thanos=h_thanos; 47 | dup_bahu=h_bahu; 48 | } 49 | void fight::tattack() 50 | { 51 | cout<<"****************THIS IS FOR GOOD**************"<61.5) //if this is the condition then there will be no damage to the opponent 54 | { // do nothing // this condition is superier then the below condition logically 55 | } 56 | else if (t_attack_no%2==0 && t_attack_no!=0) 57 | { 58 | h_bahu-=h_bahu*(0.20); // according to the rule 5% more power 59 | } 60 | else 61 | { 62 | h_bahu-=h_bahu*(0.15); 63 | } 64 | att_bahu_time+=1; 65 | att_thanos_time+=2.5; 66 | attack_no+=1; 67 | t_attack_no+=1; 68 | display(); 69 | } 70 | void fight::battack() 71 | { 72 | cout<<"******************JAI MAHESHMATI*****************"<61.5) //if this is the condition then there will be no damage to the opponent 75 | { // do nothing // this condition is superier then the below condition logically 76 | } 77 | else if (b_attack_no%3==0 && b_attack_no!=0) 78 | { 79 | h_thanos-=h_thanos*(0.18); // according to the rule 8% more power 80 | } 81 | else 82 | { 83 | h_thanos-=h_thanos*(0.10); 84 | } 85 | att_bahu_time+=2; 86 | att_thanos_time+=1; 87 | attack_no+=1; 88 | b_attack_no+=1; 89 | display(); 90 | 91 | } 92 | string fight::start() 93 | { 94 | while(h_bahu>0.1 && h_thanos>0.1) 95 | { 96 | if (t==att_thanos_time) 97 | { 98 | tattack(); 99 | } 100 | if (t==att_bahu_time) 101 | { 102 | battack(); 103 | } 104 | //display(h_bahu,h_thanos,attack_no); 105 | t+=0.5; 106 | } 107 | if (h_bahu>0) 108 | return "Bahubhali wins"; 109 | 110 | return "Thanos wins"; 111 | } 112 | int main() 113 | { 114 | fight f; 115 | f.checkinputs(); 116 | srand (time(NULL)); 117 | cout<<"At t=0"< 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | 10 | bool effects(int n) // this is the funciton which tests the condition and rules in 3 question. 11 | { // prime or not and is it divisible by 13 or 15 12 | if (n <= 1) 13 | return false; 14 | for (int i = 2; i < n; i++) 15 | {if (n % i == 0) 16 | { 17 | return false; 18 | } 19 | } 20 | if (n%13==0 || n%15==0) 21 | return true; 22 | 23 | return false; 24 | } 25 | class fight 26 | { 27 | private: 28 | float h_thanos=0,h_bahu=0,att_thanos_time=0,att_bahu_time=0; 29 | float t=0; 30 | float dup_thanos=0,dup_bahu=0; 31 | int attack_no=0,b_attack_no=0,t_attack_no=0; 32 | public: 33 | fight() 34 | { 35 | cout<<"Enter the health of thanos and bhaubhali, either same or maximum difference of 5%"<>h_thanos>>h_bahu; 37 | } 38 | void display() 39 | { 40 | cout<<"health of bahu "<5) 55 | { 56 | cout<<"You havnt entered the valid input, please enter the valid inputs of health of both fighters"<>h_thanos>>h_bahu; 58 | ma=max(h_thanos,h_bahu); 59 | mi=min(h_thanos,h_bahu); 60 | } 61 | dup_thanos=h_thanos; 62 | dup_bahu=h_bahu; 63 | } 64 | void fight::tattack() 65 | { 66 | cout<<"***************THIS IS FOR GOOD BUT WHO TOOK MY STONE******************"<61.5) 76 | { 77 | } 78 | else if (t_attack_no%2==0 && t_attack_no!=0) 79 | { 80 | h_bahu=h_bahu - h_bahu*(damage+0.5); 81 | } 82 | else 83 | { 84 | h_bahu=h_bahu- h_bahu*(damage); 85 | } 86 | att_bahu_time+=1; 87 | att_thanos_time+=3; // reattacking time is increased to 3sec 88 | attack_no+=1; 89 | t_attack_no+=1; 90 | } 91 | void fight::battack() 92 | { 93 | cout<<"***********JAI MAHESHMATI*************"<61.5) 96 | { 97 | } 98 | else if (b_attack_no%3==0 && b_attack_no!=0) 99 | { 100 | h_thanos-= h_thanos*(0.18); 101 | } 102 | else 103 | { 104 | h_thanos-=h_thanos*(0.10); 105 | } 106 | att_bahu_time+=2; 107 | att_thanos_time+=3; // recover time is increased to 3 sec 108 | attack_no+=1; 109 | b_attack_no+=1; 110 | 111 | } 112 | string fight::start() 113 | { 114 | while(h_bahu>=0.1 && h_thanos>=0.1) 115 | { 116 | if (t==att_thanos_time) 117 | { 118 | tattack(); 119 | display(); 120 | } 121 | if (t==att_bahu_time) 122 | { 123 | battack(); 124 | display(); 125 | } 126 | //display(h_bahu,h_thanos,attack_no); 127 | t+=0.5; 128 | } 129 | if (h_bahu>0) 130 | return "Bahubhali wins"; 131 | 132 | return "Thanos wins"; 133 | } 134 | int main() 135 | { 136 | fight f; 137 | f.checkinputs(); 138 | srand (time(NULL)); 139 | cout<<"At t=0"< 4. We are reading each subject each day, i.e. 6 subjects in 6 hours each day. 28 | 29 | 30 | LIKE : 31 | Course coverage : 32 | 1 subject = 10 chapters 33 | 1 chapter = 6 subtopics 34 | 1 hour = 3 subtopics 35 | 2 hour = 6 subtopics = 1 chapter 36 | 1 chapter = 2 hours 37 | 10 chapter = 20 hours = 5 units 38 | 5 unit = 20 hours 39 | 1 subject = 5 units= 20 hours 40 | 2 subjects = 40 hours 41 | 42 | DISLIKE : 43 | Course coverage : 44 | 1 subject = 10 chapters 45 | 1 chapter = 6 subtopics 46 | 1 hour = 2 subtopics 47 | 3 hour = 6 subtopics = 1 chapter 48 | 1 chapter = 3 hours 49 | 10 chapter = 30 hours = 5 units 50 | 1 subject = 30 hours 51 | 4 subjects = 120 hours 52 | 53 | So the net time required to complete the whole syllabus is 160 hours 54 | 55 | MARKS DISTRIBUTION : 56 | 1 subject = 90 marks 57 | 1 subject = 5 units 58 | 1 unit = 90/15 = 18 marks 59 | 1 unit = 18 marks 60 | -------------------------------------------------------------------------------- /2019/soumilk/Internship screening test-2/Explanation of code.txt: -------------------------------------------------------------------------------- 1 | Explanation of whole code in this file, 2 | It is suggested to open code in half of the desktop 3 | 4 | 5 | 1. Initially an abstract class named 'properties' is made because 6 | these properties is common among all the subjects. 7 | 2. All the assumptions and paratamers are stated in the file named 8 | 'Approach.txt' in this folder. 9 | 3. Class 'subject' has inherited the abstract class, and as it is 10 | necessary to overload the pure virtual function of the abstract Class in the 11 | derived class, so the function 'chapter_assignment' has been overloaded. 12 | 13 | 4. The class is having the vector of a tuple with the the first element of tuple 14 | be the unit number and the another is the chapter. 15 | 16 | 5. 'subject()' is the default constructor which is performing the following 17 | tasks : 18 | - Input of the name of the subject 19 | - calling the function 'chapter_assignment()' 20 | - calling the function 'unit_choosing()'. 21 | - initialising the variable subtopics_done with 0. 22 | 23 | 6. the task of the function 'chapter_assignment()' is : 24 | - initialise a random seed with srand. 25 | - assign the number of chapters to the units randomly. 26 | - The assignment of the chapter is done in the range of 1-4 27 | 28 | 7. Now the unit and their assignmenti stored in the vector of tuple with 29 | two paratamers (unit, chapter). 30 | 31 | 8. the task of function 'unit_choosing()' 32 | - Now as we want to optiise the study plan and want to learn the units which 33 | have the minimum no. of chapter as each unit has equal marks assigned. 34 | - Sorted the vector tuple according the the firs index of the tuple i.e. 35 | according to the number of chapters. 36 | - function 'sortbysec()' is used in the sorting of the tuple. 37 | 38 | 9. Now come to the main function (), a vector of type 'subject' is made, 39 | basically a vector array which will keep the objects of class 'subject'. 40 | 41 | 10. A array of marks which will keep the record of marks in each subject. 42 | 43 | 11. Inputs are taken from the user. 44 | 12. As soon as object is created the constructor is called and it performs the 45 | tasks as defined above. 46 | 47 | 13. the task of 'marks_distribution()' function is to distribute the marks to 48 | each subtopic of a particular unit according to the number of chapters . 49 | 50 | 14. the task of the 'display()' function is to display the index of each subject 51 | - units in sorted order according to the subjects 52 | - number of chapters in each unit and the marks distribution i.e the marks 53 | associated with 1 subtopic of that unit. 54 | 55 | 15. now the loop for 23 days is executed as we have only 23 days to prepare for RTU exams. 56 | 16. The 'studyplan ()' function is defined as a friend funtion, (not used as such here but could be used 57 | if we want to access functions of class like 'display()' etc.) 58 | 17. the task of function ' studyplan()' is to read each subject in 1 hour slot everyday to get 59 | optimum results so as we score the maximum in every subject. 60 | - As we read a subject, then the marks[] is updated to the marks of the read content worth. 61 | - We then find the subject which is having the minimum marks till now and then study that 62 | subject, so as to maintain balance between each subject and perform equally well in each 63 | subject . 64 | - the vector of objects is passed as the ' reference' to the 'studyplan ()' function because there 65 | will be updates in the variable 'subtopics_done' which id defined in the class. 66 | 67 | 18. studyplan() function is calling the function study(), after the selection of the subject to study 68 | we need to study that subject. 69 | - study function determines two conditions and mark the subtopics to be done (like or not). 70 | - now if the subtopics of the unit is read completely then we will go to the next unit. 71 | - the marker which is telling us the unit is 'index_of_unit' in the code. 72 | - returning the score of the currently studied material, and the marks[] is updated. 73 | 74 | 19. The marks table of each subject is printed out. 75 | 76 | 20. This code depicts the approach, the practical problem is o ddifferent. 77 | It can be solved in the similar manner. 78 | -------------------------------------------------------------------------------- /2019/soumilk/Internship screening test-2/Question.txt: -------------------------------------------------------------------------------- 1 | You need to prepare the study plan for the RTU semester examination as well as external practical exams, but there are certain constraints 2 | which you need to follow in order to make your action plan. 3 | 4 | Q. 5 | You have total of 6 subjects, and each subject has 5 unit (comprising 10 chapters). Assignment of number of chapters is up to you. 6 | Out of 6 subjects, you like 2 subjects and dislike 4 subjects. You cannot study the subjects you dislike more than 2 hours in a day 7 | and there is no constraint on the hours of study of the subjects you like (max 6 hours). 8 | Each chapter has 6 subtopics and you can read only 3 subtopics of the subject you like and 2 subtopics of the subject you dislike in an hour. 9 | You can only give a study of maximum 6 hours a day. 10 | Each subject is of 90 marks which is divided into 5 units. 11 | 12 | 13 | Your RTU exams are approaching and there are only 23 days left to complete the course. You need to be really efficient in choosing the 14 | units (basically with minimum no. of chapters) and complete the course as soon as possible. 15 | 16 | 17 | 1. You need to study in such a way that you can score maximum. 18 | 2. Print the study of each day in the format (subject_unit_chapter_subtopic). 19 | 20 | Q. 21 | Right after the RTU examination you have the practical exams. 22 | There are 4 practical labs and each lab has total 12 practical. You will study for the 3 hours a day and can learn total of 4 practical. 23 | You have 7 days to prepare for the practical exams. 24 | 25 | //// Whats the optimisation question for this one sir, if I need to learn the practical then its constant ,i.e. 26 | in 1 day=> 3 hours= 4 practical 27 | in 7 days=> 3*7= 21 hours of study. 28 | 21 hours = 28 practical 29 | 30 | 1 subject= 12 practical 31 | 4 subject= 48 practical 32 | 33 | Please pardon the question. 34 | /// 35 | -------------------------------------------------------------------------------- /2019/soumilk/Internship screening test-2/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyJaipur/100DaysOfCode/2bb37271133ed63f3330d3884ced7322a95b824f/2019/soumilk/Internship screening test-2/a.out -------------------------------------------------------------------------------- /2019/soumilk/Internship screening test-2/sample output: -------------------------------------------------------------------------------- 1 | soumil@soumil-VirtualBox:~/Desktop/All tasks/Airavath$ clear 2 | 3 | soumil@soumil-VirtualBox:~/Desktop/All tasks/Airavath$ g++ RTU1.cpp 4 | soumil@soumil-VirtualBox:~/Desktop/All tasks/Airavath$ ./a.out 5 | Total number of Subjects = 6 6 | Each subject has= units=5 Each unit has chapters=10 subtopics in each chapter=6 7 | Enter the details of subject 1 8 | Name of the subject ? 9 | OS 10 | Do you like OS subject yes/no ? 11 | yes 12 | Enter the details of subject 2 13 | Name of the subject ? 14 | DLD 15 | Do you like DLD subject yes/no ? 16 | no 17 | Enter the details of subject 3 18 | Name of the subject ? 19 | EDC 20 | Do you like EDC subject yes/no ? 21 | no 22 | Enter the details of subject 4 23 | Name of the subject ? 24 | TEF 25 | Do you like TEF subject yes/no ? 26 | no 27 | Enter the details of subject 5 28 | Name of the subject ? 29 | DBMS 30 | Do you like DBMS subject yes/no ? 31 | yes 32 | Enter the details of subject 6 33 | Name of the subject ? 34 | ITC 35 | Do you like ITC subject yes/no ? 36 | no 37 | ******* This is the Index of the subjects ******** 38 | Name Of Subject : OS 39 | Unit - 2 Chapters - 1 Marks distribution 3 40 | Unit - 3 Chapters - 1 Marks distribution 3 41 | Unit - 0 Chapters - 2 Marks distribution 1.5 42 | Unit - 1 Chapters - 3 Marks distribution 1 43 | Unit - 4 Chapters - 3 Marks distribution 1 44 | Name Of Subject : DLD 45 | Unit - 1 Chapters - 1 Marks distribution 3 46 | Unit - 2 Chapters - 1 Marks distribution 3 47 | Unit - 3 Chapters - 1 Marks distribution 3 48 | Unit - 4 Chapters - 3 Marks distribution 1 49 | Unit - 0 Chapters - 4 Marks distribution 0.666667 50 | Name Of Subject : EDC 51 | Unit - 2 Chapters - 1 Marks distribution 3 52 | Unit - 3 Chapters - 1 Marks distribution 3 53 | Unit - 1 Chapters - 2 Marks distribution 1.5 54 | Unit - 0 Chapters - 3 Marks distribution 1 55 | Unit - 4 Chapters - 3 Marks distribution 1 56 | Name Of Subject : TEF 57 | Unit - 2 Chapters - 1 Marks distribution 3 58 | Unit - 3 Chapters - 1 Marks distribution 3 59 | Unit - 0 Chapters - 2 Marks distribution 1.5 60 | Unit - 1 Chapters - 3 Marks distribution 1 61 | Unit - 4 Chapters - 3 Marks distribution 1 62 | Name Of Subject : DBMS 63 | Unit - 1 Chapters - 1 Marks distribution 3 64 | Unit - 2 Chapters - 1 Marks distribution 3 65 | Unit - 3 Chapters - 2 Marks distribution 1.5 66 | Unit - 0 Chapters - 3 Marks distribution 1 67 | Unit - 4 Chapters - 3 Marks distribution 1 68 | Name Of Subject : ITC 69 | Unit - 0 Chapters - 1 Marks distribution 3 70 | Unit - 2 Chapters - 1 Marks distribution 3 71 | Unit - 3 Chapters - 1 Marks distribution 3 72 | Unit - 4 Chapters - 3 Marks distribution 1 73 | Unit - 1 Chapters - 4 Marks distribution 0.666667 74 | ***********DAY 1 ************** 75 | OS_2 DLD_1 EDC_2 TEF_2 DBMS_1 ITC_0 76 | ***********DAY 2 ************** 77 | DLD_1 EDC_2 TEF_2 ITC_0 OS_2 DBMS_1 78 | ***********DAY 3 ************** 79 | DLD_1 EDC_2 TEF_2 ITC_0 OS_3 DLD_2 80 | ***********DAY 4 ************** 81 | EDC_3 TEF_3 DBMS_2 ITC_2 DLD_2 EDC_3 82 | ***********DAY 5 ************** 83 | TEF_3 ITC_2 OS_3 DBMS_2 DLD_2 EDC_3 84 | ***********DAY 6 ************** 85 | TEF_3 ITC_2 OS_0 DLD_3 EDC_1 TEF_0 86 | ***********DAY 7 ************** 87 | DBMS_3 ITC_3 EDC_1 TEF_0 OS_0 DBMS_3 88 | ***********DAY 8 ************** 89 | DLD_3 EDC_1 TEF_0 ITC_3 OS_0 DBMS_3 90 | ***********DAY 9 ************** 91 | EDC_1 TEF_0 OS_0 DLD_3 EDC_1 TEF_0 92 | ***********DAY 10 ************** 93 | DBMS_3 ITC_3 EDC_1 TEF_0 OS_1 DBMS_0 94 | ***********DAY 11 ************** 95 | DLD_4 EDC_0 TEF_1 ITC_4 OS_1 DBMS_0 96 | ***********DAY 12 ************** 97 | DLD_4 EDC_0 TEF_1 ITC_4 OS_1 DLD_4 98 | ***********DAY 13 ************** 99 | EDC_0 TEF_1 DBMS_0 ITC_4 DLD_4 EDC_0 100 | ***********DAY 14 ************** 101 | TEF_1 ITC_4 OS_1 DBMS_0 DLD_4 EDC_0 102 | ***********DAY 15 ************** 103 | TEF_1 ITC_4 OS_1 DLD_4 EDC_0 TEF_1 104 | ***********DAY 16 ************** 105 | DBMS_0 ITC_4 DLD_4 EDC_0 TEF_1 ITC_4 106 | ***********DAY 17 ************** 107 | OS_1 DBMS_0 DLD_4 EDC_0 TEF_1 ITC_4 108 | ***********DAY 18 ************** 109 | OS_4 DLD_4 EDC_0 TEF_1 DBMS_4 ITC_4 110 | ***********DAY 19 ************** 111 | DLD_0 EDC_4 TEF_4 ITC_1 OS_4 DLD_0 112 | ***********DAY 20 ************** 113 | DBMS_4 ITC_1 DLD_0 EDC_4 TEF_4 ITC_1 114 | ***********DAY 21 ************** 115 | DLD_0 ITC_1 OS_4 DLD_0 EDC_4 TEF_4 116 | ***********DAY 22 ************** 117 | DBMS_4 ITC_1 DLD_0 ITC_1 DLD_0 EDC_4 118 | ***********DAY 23 ************** 119 | TEF_4 ITC_1 OS_4 DLD_0 DBMS_4 ITC_1 120 | ************* MARKS SCORED ************** 121 | marks scored in each subject 122 | OS 82 123 | DLD 80 124 | EDC 80 125 | TEF 80 126 | DBMS 82 127 | ITC 80 128 | -------------------------------------------------------------------------------- /2019/soumilk/NYU meetup.md: -------------------------------------------------------------------------------- 1 | ###Two ambassadors from New york university pursuing MS in Computer science from Tandon school of Engineering, had a session on 12-1-2019. Both studies from Tier-3 2 | college and did a job for about 1.5 year. 3 | 1. Ayush Sethi
4 | 2. Vaibhav Lodha 5 |
6 | They are really helpful guys and if you are planning for GRE then you may reach out to them.
7 | Here I have mentioned some of my questions and answerd given by them. I hope it might be helpful in some manner.
8 | For furher info you can reach out to me.
9 | 10 | -> Q. Sir, I am really in a dilemma that what should I do now, because the IT industry is developing drastically and its becoming nearly
impossible for me to match up with the market requirements.
11 | A. No company expects you to be the master of new technology, they just want to check your basics and foundation. 12 |
13 | 14 | -> Q. Is it really necessary to learn new technologies like ML, Blockchain, IOT etc for a good placement?
15 | A. Not at all, at your stage, only things that are expected from you is the basic core subjects of the computer science. 16 | company train their employees according to their project, yes it is good to have a piece of knowledge about the recent tech
but focus on your core subjects like DSA, Database, OS etc. 17 |
18 | -> Q. I am always confused between the various streams, sometimes I think I should go in development then I switch to CP then I
19 | think I should invest time in ML then my college syllabus stuck my mind, have to maintain my percentage !!!
20 | A. Its quite natural and there is no need to worry, all you have to do is to find your interest and you can do it when you work
21 | in the various streams. Just find that one stream which matches your passion and give you happiness, after that Don't scatter
22 | your energy and concentrate on that only thing. 23 |
24 | -> Q. what tech has the most developing market?
25 | A. There is nothing like a particular section lead the market of IT, we need everyone from a data analyst to a programmer, from 26 | a hacker to an animation designer. Every stream has a lot of scopes, all you need to do is have a good grasp on that 27 | subject. You can't be good in everything but just make a command of that one thing and that will be enough for you. Just keep 28 | updating your knowledge bank. 29 |
30 | -> Q. What kind of project should I make? I don't want to make a unique project, common projects do not interest me that much.
31 | A. It is not the matter that you are making or an already implemented project, the thing which matters is what you have
32 | learned. Even if a project is common, what the matter of concern is can you built it! 33 |
34 | -> Q. Being in a Tier-3 college affect our placement in tech giants ? I mean like students from IITs or IISCrs get a priority? 35 | A. Now this barrier is fading out. Companies do not really care about your college, all they care about is your skill. This is the reason why most of the companies are conducting online competitions. 36 |
37 | -------------------------------------------------------------------------------- /2019/soumilk/Sorting algorithm O(n^2).cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void swap(int *p,int *q) 5 | { 6 | int temp=*p; 7 | *p=*q; 8 | *q=temp; 9 | } 10 | void printarray(int arr[],int n) 11 | { 12 | for(int i=0;i0 && arr[pos]>n; 67 | int arr[n]; 68 | for (int i=0;i>arr[i]; 71 | } 72 | cout<<"Now sorting the array"< This will give an error as we are trying to access file when it is closed 36 | -------------------------------------------------------------------------------- /2019/soumilk/python IO/io_in_python.py: -------------------------------------------------------------------------------- 1 | #File Objects 2 | 3 | ##The Basics: 4 | #f = open("test.txt", "r") 5 | #f = open("test.txt", "w") 6 | #f = open("test.txt", "a") 7 | #f = open("test.txt", "r+") 8 | #print(f.name) 9 | #print(f.mode) 10 | #f.close() 11 | 12 | ##Reading Files: 13 | #with open("test.txt", "r") as f: 14 | #pass 15 | 16 | ##Small Files: 17 | #f_contents = f.read() 18 | #print(f_contents) 19 | 20 | ##Big Files: 21 | #f_contents = f.readlines() 22 | #print(f_contents) 23 | 24 | ###With the extra lines: 25 | #f_contents = f.readline() 26 | #print(f_contents) 27 | #f_contents = f.readline() 28 | #print(f_contents) 29 | 30 | ###Without the extra lines: 31 | #f_contents = f.readline() 32 | #print(f_contents, end = '') 33 | #f_contents = f.readline() 34 | #print(f_contents, end = '') 35 | 36 | ###Iterating through the file: 37 | #for line in f: 38 | #print(line, end = '') 39 | 40 | ###Going Back....: 41 | #f_contents = f.read() 42 | #print(f_contents, end = '') 43 | 44 | ###Printing by characters: 45 | #f_contents = f.read(100) 46 | #print(f_contents, end = '') 47 | #f_contents = f.read(100) 48 | #print(f_contents, end = '') 49 | #f_contents = f.read(100) 50 | #print(f_contents, end = '') 51 | 52 | ###Iterating through small chunks: 53 | #size_to_read = 100 54 | #f_contents = f.read(size_to_read) 55 | #while len(f_contents) > 0: 56 | #print(f_contents) 57 | #f_contents = f.read(size_to_read) 58 | 59 | ###Iterating through small chunks, with 10 characters: 60 | #size_to_read = 10 61 | #f_contents = f.read(size_to_read) 62 | #print(f_contents, end = '') 63 | #f.seek(0) 64 | #f_contents = f.read(size_to_read) 65 | #print(f_contents, end = '') 66 | #print(f.tell()) 67 | #while len(f_contents) > 0: 68 | #print(f_contents, end = '*') 69 | #f_contents = f.read(size_to_read) 70 | #print(f.mode) 71 | #print(f.closed) 72 | #print(f.read()) 73 | 74 | 75 | ##Writing Files: 76 | ###The Error: 77 | #with open("test.txt", "r") as f: 78 | #f.write("Test") 79 | 80 | ###Writing Starts: 81 | #with open("test2.txt", "w") as f: 82 | #pass 83 | #f.write("Test") 84 | #f.seek(0) 85 | #f.write("Test") 86 | #f.seek("R") 87 | 88 | ##Copying Files: 89 | #with open("test.txt", "r") as rf: # from test.txt we are copying data in test_copy 90 | #with open("test_copy.txt", "w") as wf: # If not already present then it will make a new file name test_copy and start to write from test.txt 91 | #for line in rf: 92 | #wf.write(line) 93 | 94 | #Copying the/your image: 95 | ###The Error 96 | #with open("bronx.jpg", "r") as rf: 97 | #with open("bronx_copy.jpg", "w") as wf: 98 | #for line in rf: 99 | #wf.write(line) 100 | 101 | ###Copying the image starts, without chunks: 102 | #with open("bronx.jpg", "rb") as rf: 103 | #with open("bronx_copy.jpg", "wb") as wf: 104 | #for line in rf: 105 | #wf.write(line) 106 | 107 | ###Copying the image with chunks: 108 | #with open("bronx.jpg", "rb") as rf: 109 | #with open("bronx_copy.jpg", "wb") as wf: 110 | #chunk_size = 4096 111 | #rf_chunk = rf.read(chunk_size) 112 | #while len(rf_chunk) > 0: 113 | #wf.write(rf_chunk) 114 | #rf_chunk = rf.read(chunk_size) 115 | -------------------------------------------------------------------------------- /2019/soumilk/python IO/test.txt: -------------------------------------------------------------------------------- 1 | this is a text file 2 | with multiple lines of data 3 | third line 4 | fourth lin 5 | fifte line 6 | sixth line 7 | seventh line 8 | eight line 9 | ninth line 10 | tenth line 11 | -------------------------------------------------------------------------------- /2019/spandey232/README.md: -------------------------------------------------------------------------------- 1 | # Shubham Pandey` 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 01/matix-generation-and-operations.py: -------------------------------------------------------------------------------- 1 | ############################################## 2 | # Author: Tanay Mehta 3 | # Github: https://github.com/tanaymehta28 4 | # Twitter: https://twitter.com/Tanaymehta28 5 | ############################################## 6 | 7 | import random 8 | 9 | # Oh come on, if you have ever used numpy; you know what this all is about. 10 | # I have made two classes for (1d and 2d) matrix generation. 11 | # The other class (MatrixOps) consists of numerous matrix operations. 12 | class oneD: 13 | def zeroes(n): 14 | array=[0 for temp_03cxfc in range(n)] 15 | return array 16 | def rand(n): 17 | array = [random.random() for temp_03xfc in range(n)] 18 | return array 19 | class twoD: 20 | def zeroes(a,b): 21 | array = [[0 for temp_03cfg in range(a)] for temp_03cfh in range(b)] 22 | return array 23 | def rand(a,b): 24 | array = [[random.random() for temp_03cfg in range(a)] for temp_03cfh in range(b)] 25 | return array 26 | class MatrixOps: 27 | def transpose(array): 28 | transpose_array = [[array[j][i] for j in range(len(array))] for i in range(len(array[0]))] 29 | return transpose_array 30 | 31 | # More coming here soon! 32 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 02/lr.py: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # Author: Tanay Mehta 3 | # Github: https://github.com/tanaymehta28 4 | # Twitter: https://twitter.com/Tanaymehta28 5 | ########################################### 6 | 7 | # NOTE: I have not included the Boston House Pricing training and testing csv files to make this repo smaller in size 8 | # So please download it from Kaggle and place in this same directory before doing any further operations. 9 | 10 | import pandas as pd 11 | import numpy as np 12 | 13 | train = pd.DataFrame(pd.read_csv("train.csv")) 14 | 15 | 16 | train.head() 17 | train = (train-train.mean())/(train.std()) 18 | 19 | X = train.iloc[:, 1:14] 20 | 21 | Y = train.iloc[:, 14:15].values 22 | 23 | id = train.iloc[:, 0:1].values 24 | 25 | theta = (np.zeros([1,len(X)])) 26 | 27 | ones = np.ones([X.shape[0],1]) 28 | 29 | X = np.concatenate((ones,X),axis=1) 30 | 31 | alpha = 0.001 32 | epochs = 10000 33 | 34 | def computeCost(X,y,theta): 35 | summ = (np.matmul(theta,X)-y)**2 36 | return np.sum(summ)/(2*len(X)) 37 | 38 | computeCost(X,Y,theta) 39 | 40 | def GradientDescentOptimizer(X,y,theta,alpha,epochs): 41 | cost = np.zeros(epochs) 42 | for i in range(epochs): 43 | theta = theta-(alpha/len(X))*np.sum(np.matmul(X,(np.matmul(X,theta)-y)) 44 | cost[i] = computeCost(X,y,theta) 45 | return theta,cost 46 | 47 | g,Cost = GradientDescentOptimizer(X,Y,theta,alpha,epochs) 48 | ## Work under Progress 49 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 03/.ignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 04/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stwitter 5 | 6 | 7 | 8 |
9 |

Stwitter

10 |

Welcome to Stwitter! (Still under development)
To Stweet something, Enter your Name (or you can be anonymous!) and your message in the
respective fields below and press GO!

11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 04/main.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Anton|Happy+Monkey|Lobster|Thasadith|Ubuntu'); 2 | 3 | body{ 4 | background-image: linear-gradient(to left,blue,purple); 5 | } 6 | 7 | #head{ 8 | color: black; 9 | font-family: 'Lobster', cursive; 10 | text-align: center; 11 | font-size: 70px; 12 | } 13 | #info{ 14 | font-family: 'Anton', sans-serif; 15 | font-size: 25px; 16 | text-align: center; 17 | } 18 | 19 | form{ 20 | text-align:center; 21 | } 22 | 23 | input[type=text], textarea{ 24 | border: 0; 25 | border-bottom: 2px solid blue; 26 | background: transparent; 27 | margin-right:12px; 28 | font-family:"Thasadith", sans-serif; 29 | font-size: 20px; 30 | color:white 31 | } 32 | textarea{ 33 | width:30%; 34 | height:100px; 35 | display:inline-block; 36 | resize:none; 37 | } 38 | input[type=text]{ 39 | margin:12px; 40 | } 41 | label{ 42 | font-family: "Thasadith", sans-serif; 43 | font-size:22px; 44 | } 45 | 46 | #go{ 47 | width:80px; 48 | height:35px; 49 | margin-top:22px; 50 | border-radius:7px; 51 | border:none; 52 | font-family:Thasadith; 53 | font-weight:bold; 54 | background:blue; 55 | } 56 | #go:hover{ 57 | background: darkblue; 58 | } 59 | label{ 60 | color:white; 61 | } 62 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 06/logistic_regression.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import sklearn.datasets 3 | 4 | print("Downloading Iris dataset") 5 | iris = sklearn.datasets.load_iris() 6 | X = iris.data[:, :3] 7 | y = (iris.target != 0) * 1 8 | print("Iris Dataset Downloaded") 9 | 10 | class LogisticRegression: 11 | def __init__(self, learning_rate, num_iters, fit_intercept = True, verbose = False): 12 | self.learning_rate = learning_rate 13 | self.num_iters = num_iters 14 | self.fit_intercept = fit_intercept 15 | self.verbose = verbose 16 | def __add_intercept(self, X): 17 | intercept = np.ones((X.shape[0],1)) 18 | return np.concatenate((intercept,X),axis=1) 19 | def __sigmoid(self,z): 20 | return 1/(1+np.exp(-z)) 21 | def __loss(self, h, y): 22 | return (-y * np.log(h) - (1-y) * np.log(1-h)).mean() 23 | 24 | def fit(self,X,y): 25 | if self.fit_intercept: 26 | X = self.__add_intercept(X) 27 | self.theta = np.zeros(X.shape[1]) 28 | 29 | for i in range(self.num_iters): 30 | z = np.dot(X,self.theta) 31 | h = self.__sigmoid(z) 32 | gradient = np.dot(X.T,(h-y))/y.size 33 | 34 | self.theta -= self.learning_rate * gradient 35 | 36 | z = np.dot(X,self.theta) 37 | h = self.__sigmoid(z) 38 | loss = self.__loss(h,y) 39 | 40 | if self.verbose == True and i % 1000 == 0: 41 | print("loss:",loss) 42 | def predict_probability(self,X): 43 | if self.fit_intercept: 44 | X = self.__add_intercept(X) 45 | return self.__sigmoid(np.dot(X,self.theta)) 46 | def predict(self,X): 47 | return (self.predict_probability(X).round()) 48 | 49 | 50 | model = LogisticRegression(learning_rate = 0.1,num_iters=100000,verbose=True) #Define the model 51 | 52 | model.fit(X, y) #Trains the model. 53 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 07/tf mnist.py: -------------------------------------------------------------------------------- 1 | # This Neural Network is trained on MNIST image dataset. 2 | # But two great things about this model are: 3 | # 1. It classifies images but it is NOT a Convolutional Network. 4 | # 2. It uses no high-level Tensorflow API (like, tf.keras and tf.estimator or tf.learn) 5 | 6 | import tensorflow as tf 7 | 8 | from tensorflow.examples.tutorials.mnist import input_data 9 | mnist = input_data.read_data_sets('/tmp/data/',one_hot=True) 10 | 11 | # Hyper-parameters 12 | batch_size = 150 13 | learning_rate = 0.001 14 | input_neuron = 28*28 #Dimensions of the Input Data 15 | hidden_layer_one = 768 # Number of neurons in the first Hidden layer 16 | hidden_layer_two = 768 # Number of neurons in the Second Hidden layer 17 | hidden_layer_three = 768 # Number of neurons in the Third Layer 18 | output_neuron = 10 # Number of the classes we want to predict 19 | 20 | # Basic input and output Placeholders 21 | x = tf.placeholder(tf.float32,[None,input_neuron]) 22 | y = tf.placeholder(tf.float32,[None,output_neuron]) 23 | 24 | # Basic Computation Graph for the Neural Network 25 | def Neural_Network(data): 26 | # Hidden Layer and Output Layer Weights Initialization 27 | hidden_one_w = tf.Variable(tf.random_uniform([input_neuron,hidden_layer_one],seed=12)) 28 | hidden_two_w = tf.Variable(tf.random_uniform([hidden_layer_one,hidden_layer_two],seed=12)) 29 | hidden_three_w = tf.Variable(tf.random_uniform([hidden_layer_two,hidden_layer_three],seed=12)) 30 | output_w = tf.Variable(tf.random_uniform([hidden_layer_three,output_neuron],seed=12)) 31 | 32 | # Hidden Layer and Output Layer Biases Initialization 33 | hidden_one_bias = tf.Variable(tf.random_uniform([hidden_layer_one],seed=12)) 34 | hidden_two_bias = tf.Variable(tf.random_uniform([hidden_layer_two],seed=12)) 35 | hidden_three_bias = tf.Variable(tf.random_uniform([hidden_layer_three],seed=12)) 36 | output_bias = tf.Variable(tf.random_uniform([output_neuron],seed=12)) 37 | 38 | # Main Computation Graph for Matrix Multiplication and Addition 39 | h_1 = tf.add(tf.matmul(x,hidden_one_w),hidden_one_bias) 40 | h_2 = tf.add(tf.matmul(h_1,hidden_two_w),hidden_two_bias) 41 | h_3 = tf.add(tf.matmul(h_2,hidden_three_w),hidden_three_bias) 42 | out = tf.add(tf.matmul(h_3,output_w),output_bias) 43 | return out 44 | 45 | # Training the Neural Network 46 | def train_neural_network(x): 47 | prediction = Neural_Network(x) 48 | cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=prediction,labels=y)) 49 | optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost) 50 | init = tf.global_variables_initializer() 51 | 52 | with tf.Session() as sess: 53 | sess.run(init) 54 | for epoch in range(25): 55 | epoch_loss = 0 56 | for _ in range(int(mnist.train.num_examples/batch_size)): 57 | epoch_x, epoch_y = mnist.train.next_batch(batch_size) 58 | _, c = sess.run([optimizer,cost], feed_dict={x: epoch_x,y: epoch_y}) 59 | epoch_loss += c 60 | print('Epoch',epoch,'completed out of',epochs,'loss:',epoch_loss) 61 | correct = tf.equal(tf.argmax(prediction,1), tf.argmax(y,1)) 62 | 63 | accuracy = tf.reduce_mean(tf.cast(correct,'float')) 64 | print('Accuracy:',accuracy.eval({x: mnist.test.images, y:mnist.test.labels})) 65 | 66 | # Function Call 67 | train_neural_network(x) 68 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 08/kernel_main.asm: -------------------------------------------------------------------------------- 1 | BITS 32 2 | 3 | start: 4 | mov ax, 07C0h ;4K Stack Space 5 | add ax, 288 ;16 Bytes Per Paragraph 6 | mov ax, ss 7 | mov 4096, sp 8 | mov ax, 07C0h 9 | mov ds, ax 10 | 11 | mov si, text_string 12 | call print_string 13 | 14 | jmp $ 15 | 16 | text_string db 'Welcome to Project DarkSpark v0.1. We are happy to have you Test our OS', 0 17 | 18 | print_string: 19 | mov ah, 0Eh 20 | 21 | .repeat: 22 | lodsb 23 | cmp al, 0 24 | je .done 25 | int 10h 26 | jmp .repeat 27 | 28 | .done: 29 | ret 30 | times 510-($-$$) db 0 31 | 32 | dw 0xAA55 33 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 09/core.js: -------------------------------------------------------------------------------- 1 | import * as tf from '@tensorflow/tfjs'; 2 | 3 | import {IMAGE_H, IMAGE_W, MnistData} from './data'; 4 | import * as ui from './ui'; 5 | 6 | /** 7 | @returns {tf.Model} 8 | */ 9 | function createConvModel() { 10 | const model = tf.sequential(); 11 | model.add(tf.layers.conv2d({ 12 | inputShape: [IMAGE_H, IMAGE_W, 1], 13 | kernelSize: 3, 14 | filters: 16, 15 | activation: 'relu' 16 | })); 17 | model.add(tf.layers.maxPooling2d({poolSize: 2, strides: 2})); 18 | model.add(tf.layers.conv2d({kernelSize: 3, filters: 32, activation: 'relu'})); 19 | model.add(tf.layers.maxPooling2d({poolSize: 2, strides: 2})); 20 | model.add(tf.layers.conv2d({kernelSize: 3, filters: 32, activation: 'relu'})); 21 | model.add(tf.layers.flatten({})); 22 | 23 | model.add(tf.layers.dense({units: 64, activation: 'relu'})); 24 | model.add(tf.layers.dense({units: 10, activation: 'softmax'})); 25 | 26 | return model; 27 | } 28 | 29 | /** 30 | @returns {tf.Model} 31 | */ 32 | function createDenseModel() { 33 | const model = tf.sequential(); 34 | model.add(tf.layers.flatten({inputShape: [IMAGE_H, IMAGE_W, 1]})); 35 | model.add(tf.layers.dense({units: 42, activation: 'relu'})); 36 | model.add(tf.layers.dense({units: 10, activation: 'softmax'})); 37 | return model; 38 | } 39 | 40 | /** 41 | * @param {*} model 42 | */ 43 | async function train(model) { 44 | ui.logStatus('Training model...'); 45 | 46 | const LEARNING_RATE = 0.01; 47 | const optimizer = 'rmsprop'; 48 | model.compile({ 49 | optimizer, 50 | loss: 'categoricalCrossentropy', 51 | metrics: ['accuracy'], 52 | }); 53 | const batchSize = 64; 54 | 55 | const validationSplit = 0.15; 56 | 57 | const trainEpochs = ui.getTrainEpochs(); 58 | 59 | let trainBatchCount = 0; 60 | 61 | const trainData = data.getTrainData(); 62 | const testData = data.getTestData(); 63 | 64 | const totalNumBatches = 65 | Math.ceil(trainData.xs.shape[0] * (1 - validationSplit) / batchSize) * 66 | trainEpochs; 67 | let valAcc; 68 | await model.fit(trainData.xs, trainData.labels, { 69 | batchSize, 70 | validationSplit, 71 | epochs: trainEpochs, 72 | callbacks: { 73 | onBatchEnd: async (batch, logs) => { 74 | trainBatchCount++; 75 | ui.logStatus( 76 | `Training... (` + 77 | `${(trainBatchCount / totalNumBatches * 100).toFixed(1)}%` + 78 | ` complete). To stop training, refresh or close page.`); 79 | ui.plotLoss(trainBatchCount, logs.loss, 'train'); 80 | ui.plotAccuracy(trainBatchCount, logs.acc, 'train'); 81 | await tf.nextFrame(); 82 | }, 83 | onEpochEnd: async (epoch, logs) => { 84 | valAcc = logs.val_acc; 85 | ui.plotLoss(trainBatchCount, logs.val_loss, 'validation'); 86 | ui.plotAccuracy(trainBatchCount, logs.val_acc, 'validation'); 87 | await tf.nextFrame(); 88 | } 89 | } 90 | }); 91 | 92 | const testResult = model.evaluate(testData.xs, testData.labels); 93 | const testAccPercent = testResult[1].dataSync()[0] * 100; 94 | const finalValAccPercent = valAcc * 100; 95 | ui.logStatus( 96 | `Final validation accuracy: ${finalValAccPercent.toFixed(1)}%; ` + 97 | `Final test accuracy: ${testAccPercent.toFixed(1)}%`); 98 | } 99 | 100 | /** 101 | * @param {tf.Model} model 102 | */ 103 | async function showPredictions(model) { 104 | const testExamples = 100; 105 | const examples = data.getTestData(testExamples); 106 | 107 | 108 | tf.tidy(() => { 109 | const output = model.predict(examples.xs); 110 | 111 | const axis = 1; 112 | const labels = Array.from(examples.labels.argMax(axis).dataSync()); 113 | const predictions = Array.from(output.argMax(axis).dataSync()); 114 | 115 | ui.showTestResults(examples, predictions, labels); 116 | }); 117 | } 118 | 119 | function createModel() { 120 | let model; 121 | const modelType = ui.getModelTypeId(); 122 | if (modelType === 'ConvNet') { 123 | model = createConvModel(); 124 | } else if (modelType === 'DenseNet') { 125 | model = createDenseModel(); 126 | } else { 127 | throw new Error(`Invalid model type: ${modelType}`); 128 | } 129 | return model; 130 | } 131 | 132 | let data; 133 | async function load() { 134 | data = new MnistData(); 135 | await data.load(); 136 | } 137 | ui.setTrainButtonCallback(async () => { 138 | ui.logStatus('Loading MNIST data...'); 139 | await load(); 140 | 141 | ui.logStatus('Creating model...'); 142 | const model = createModel(); 143 | model.summary(); 144 | 145 | ui.logStatus('Starting model training...'); 146 | await train(model); 147 | 148 | showPredictions(model); 149 | }); 150 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 09/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | MNIST Classification in Tensorflow.js -- Tanay Mehta 4 | 5 | 6 | 7 | 47 | 48 |
49 |

TensorFlow.js: Train MNIST with the Layers API

50 | 51 |
52 |
53 | Model Type: 54 | 58 |
59 | 60 |
61 | # of training epochs: 62 | 63 |
64 | 65 | 66 |
67 | 68 |
69 |
70 | 71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 |
84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 09/loadData.js: -------------------------------------------------------------------------------- 1 | import * as tf from '@tensorflow/tfjs'; 2 | 3 | export const IMAGE_H = 28; 4 | export const IMAGE_W = 28; 5 | const IMAGE_SIZE = IMAGE_H * IMAGE_W; 6 | const NUM_CLASSES = 10; 7 | const NUM_DATASET_ELEMENTS = 65000; 8 | 9 | const NUM_TRAIN_ELEMENTS = 55000; 10 | const NUM_TEST_ELEMENTS = NUM_DATASET_ELEMENTS - NUM_TRAIN_ELEMENTS; 11 | 12 | const MNIST_IMAGES_SPRITE_PATH = 13 | 'https://storage.googleapis.com/learnjs-data/model-builder/mnist_images.png'; 14 | const MNIST_LABELS_PATH = 15 | 'https://storage.googleapis.com/learnjs-data/model-builder/mnist_labels_uint8'; 16 | 17 | export class MnistData { 18 | constructor() {} 19 | 20 | async load() { 21 | const img = new Image(); 22 | const canvas = document.createElement('canvas'); 23 | const ctx = canvas.getContext('2d'); 24 | const imgRequest = new Promise((resolve, reject) => { 25 | img.crossOrigin = ''; 26 | img.onload = () => { 27 | img.width = img.naturalWidth; 28 | img.height = img.naturalHeight; 29 | 30 | const datasetBytesBuffer = 31 | new ArrayBuffer(NUM_DATASET_ELEMENTS * IMAGE_SIZE * 4); 32 | 33 | const chunkSize = 5000; 34 | canvas.width = img.width; 35 | canvas.height = chunkSize; 36 | 37 | for (let i = 0; i < NUM_DATASET_ELEMENTS / chunkSize; i++) { 38 | const datasetBytesView = new Float32Array( 39 | datasetBytesBuffer, i * IMAGE_SIZE * chunkSize * 4, 40 | IMAGE_SIZE * chunkSize); 41 | ctx.drawImage( 42 | img, 0, i * chunkSize, img.width, chunkSize, 0, 0, img.width, 43 | chunkSize); 44 | 45 | const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); 46 | 47 | for (let j = 0; j < imageData.data.length / 4; j++) { 48 | datasetBytesView[j] = imageData.data[j * 4] / 255; 49 | } 50 | } 51 | this.datasetImages = new Float32Array(datasetBytesBuffer); 52 | 53 | resolve(); 54 | }; 55 | img.src = MNIST_IMAGES_SPRITE_PATH; 56 | }); 57 | 58 | const labelsRequest = fetch(MNIST_LABELS_PATH); 59 | const [imgResponse, labelsResponse] = 60 | await Promise.all([imgRequest, labelsRequest]); 61 | 62 | this.datasetLabels = new Uint8Array(await labelsResponse.arrayBuffer()); 63 | this.trainImages = 64 | this.datasetImages.slice(0, IMAGE_SIZE * NUM_TRAIN_ELEMENTS); 65 | this.testImages = this.datasetImages.slice(IMAGE_SIZE * NUM_TRAIN_ELEMENTS); 66 | this.trainLabels = 67 | this.datasetLabels.slice(0, NUM_CLASSES * NUM_TRAIN_ELEMENTS); 68 | this.testLabels = 69 | this.datasetLabels.slice(NUM_CLASSES * NUM_TRAIN_ELEMENTS); 70 | } 71 | 72 | /** 73 | * 74 | * @returns 75 | * 76 | */ 77 | getTrainData() { 78 | const xs = tf.tensor4d( 79 | this.trainImages, 80 | [this.trainImages.length / IMAGE_SIZE, IMAGE_H, IMAGE_W, 1]); 81 | const labels = tf.tensor2d( 82 | this.trainLabels, [this.trainLabels.length / NUM_CLASSES, NUM_CLASSES]); 83 | return {xs, labels}; 84 | } 85 | 86 | /** 87 | * @param {number} numExamples 88 | * @returns 89 | */ 90 | getTestData(numExamples) { 91 | let xs = tf.tensor4d( 92 | this.testImages, 93 | [this.testImages.length / IMAGE_SIZE, IMAGE_H, IMAGE_W, 1]); 94 | let labels = tf.tensor2d( 95 | this.testLabels, [this.testLabels.length / NUM_CLASSES, NUM_CLASSES]); 96 | 97 | if (numExamples != null) { 98 | xs = xs.slice([0, 0, 0, 0], [numExamples, IMAGE_H, IMAGE_W, 1]); 99 | labels = labels.slice([0, 0], [numExamples, NUM_CLASSES]); 100 | } 101 | return {xs, labels}; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 10/linear-regression-normal.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | data = pd.DataFrame(pd.read_csv("Admission_Predict.csv")) 5 | 6 | norm_data = (data-data.mean())/(data.max()-data.min()) 7 | 8 | data.head() 9 | norm_data.head() 10 | 11 | serial = data.iloc[:,0:1] 12 | X = norm_data.iloc[:,1:8] 13 | Y = norm_data.iloc[:,8:9] 14 | 15 | theta = np.dot((1/(np.dot(X.T,X))),np.dot(X.T,Y)) 16 | 17 | print(theta) 18 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 11/linear_regression_numpy.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | data = pd.DataFrame(pd.read_csv("Desktop/Datasets/Admission_Predict.csv")) 5 | 6 | norm_data = (data-data.mean())/(data.max()-data.min()) 7 | 8 | serial = data.iloc[:,0:1] 9 | X = norm_data.iloc[:,1:8].values 10 | Y = norm_data.iloc[:,8:9].values 11 | 12 | class LinearRegression: 13 | ''' 14 | ---------------------------------------------------------------------------------------------------------------------------------------- 15 | Parameters Required: 16 | 17 | X,y,leanring_rate, num_iters 18 | ---------------------------------------------------------------------------------------------------------------------------------------- 19 | Function Information: 20 | 21 | __generate_theta(self,X) => Generates Theta Vector from given X-Matrix 22 | __loss(self,hypothesis,y) => Calculates Loss (Predicted Value - Real value) 23 | __cost(self,hypothesis,y,m) => Calculates the Cost (J(theta)) 24 | fit(self,X,y) => Provided X & Y matrices; It Performs the Gradient Descent Optimisation to find the Optimal Value of Weight-Vector Theta 25 | ---------------------------------------------------------------------------------------------------------------------------------------- 26 | ''' 27 | 28 | 29 | def __init__(self,learning_rate,num_iters): 30 | self.learning_rate = learning_rate 31 | self.num_iters = num_iters 32 | 33 | def __generate_theta(self,X): 34 | return np.ones((X.shape[1])) 35 | 36 | def __loss(self,hypothesis,y): 37 | return np.sum(hypothesis-y) 38 | 39 | def __cost(self,hypothesis,y,m): 40 | temp01 = np.sum(hypothesis-y)**2 41 | return temp01/(2*m) 42 | 43 | def fit(self,X,y): 44 | m = y.size 45 | theta = self.__generate_theta(X) 46 | 47 | for i in range(self.num_iters): 48 | hypothesis = np.dot(X,theta) 49 | loss = self.__loss(hypothesis,y) 50 | cost = self.__cost(hypothesis,y,m) 51 | 52 | gradient = (np.sum(np.dot(X.T,(hypothesis-Y))))/m 53 | theta = theta - self.learning_rate * gradient 54 | 55 | hypothesis = np.dot(X,theta) 56 | loss = self.__loss(hypothesis,y) 57 | 58 | print("loss is: ",loss) 59 | return theta 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /2019/tanaymehta28/Day 12/noFile.md: -------------------------------------------------------------------------------- 1 | There are no files here, Because Today I have solved DSA Problems on Hackerrank. 2 | 3 | -------------------------------------------------------------------------------- /2019/tanaymehta28/README.md: -------------------------------------------------------------------------------- 1 | # Who am I? 2 | Halo! I am Tanay Mehta, a freshman studying in JECRC University. I have a strong passion for Deep Learning, Statistical Modelling, Reinforcement Learning and Computational Neuroscience. I am also 'good-enough' at MEAN Stack, Little-bit of Back-end Web Development and some Basic Web Development here and there. My plans for upcoming 100 days is to work slowly but surely on a Mathematics and Statistical Modelling Library that I am going to build in Python from scratch (P.S: My interpretation of Scratch means NO EXTERNAL LIBRARY, not even numpy). 3 | So, let's hope, we can finish our projects before 100 Days End! 4 | Happy Hacking! 5 | 6 | ### Day 1 7 | 8 | +Added 9 | 1. "matrix-generation-and-operations.py" 10 | Here, I have defined 1D and 2D Matrix generation (both zero-matrix and random-matrix). 11 | Also, I have added a class of operators called "MatrixOps" which currently has only one function, 'transpose(array)'; which as the name suggests, transposes the matrix passed as a parameter. Preferably a matrix generated from the above functions for Matrix Generation. 12 | 13 | /\Plans: To add Tensor generation and Tensors of more than 3 ranks (preferable upto 8 dimensions would work, unless you are a high-energy physicist at fermilab!(pun there.)) 14 | 15 | ### Day 2 16 | +Added 17 | 1. A Linear regression model in Python (Numpy) is added. It does multivariate Linear Regression on Boston House Pricing Dataset. It is still under work, but most of it works just fine. It is implemented in Python by only using Two External Libraries, i.e; Numpy and Pandas. 18 | 19 | /\Plans: To make it more memory efficient and decrease it's time complexity. 20 | 21 | ### Day 3 22 | +Added 23 | 1. On Day 02, I added Linear Regression in Plain old Numpy, that was great for skills and all but it lacked good accuracy and memory efficiency. That's Why I have made another Linear Regression Model but now in Core Tensorflow (NO HIGH LEVEL API, I hate these Keras, sklearn and tf.estimator api's). 24 | 25 | /\Plans: Tomorrow I will add a simple data Visualisation model in Javascript made in D3.js 26 | 27 | ### Day 4 28 | +Added 29 | 1. Today I made the front-end of a Web-app (under serious development), this web app will have it's backend made upon NodeJS (S.O.L.I.D Principles). So far only the Front-end is done and dusted, although, there are lots of changes coming to it. 30 | /\Plans: Best development happens when you do things the unplanned way! 31 | 32 | ### Day 5 33 | +Added 34 | 1. Today I learned and implemented Ray Tracing Algorithm in Python 3.5 using Numpy as Matplotlib. This Algorithm Imlpements the State-of-the are ray tracing algorithm and uses it render an image and save it too. 35 | 36 | /\Plans: Tommorow I will Implement Logistic Regression in Python using Only Numpy (and sckit-learn for Data Loading). This will be done on Iris Dataset. 37 | 38 | ### Day 6 39 | +Added 40 | 1. Today, I performed Logistic Regression in Python (Numpy) without using any external functions (like LinearRegressor in Keras, etc). This can serve as an assignment implmentation of Andrew NG's Machine Learning course's (on Coursera) 3rd/4rth Week. It only uses Scikit-learn for importing training data. This is done on Iris Dataset. 41 | 42 | /\Plans: Honestly! I don't know!! 43 | 44 | 45 | ### Day 7 46 | +Added 47 | 1. Today I codded out a Neural Network in Core Tensorflow (remember, I am Against any High-level APIs!). This Neural Network Classifies MNIST-Handwritten Images, but here's the catch; It does that without a Convolution Function! This although Decreases it's Accuracy, but it is a great representation on how powerfull even the most basic neural networks are. 48 | 49 | /\Plans: Why do I even have this Section here? 50 | 51 | ### Day 8 52 | +Added 53 | 1. Today I coded out a simple Kernel (yes, an Operating System Kernel!) in Assemble_x86 and tried to boot in the QEMU-emulator. This is good only for representation purpose; but still teaches alot about Assembly_x86 Language. 54 | 55 | /\Plans: I am planning to add on some simple on-boot programs in C-lang that makes this new OS (I named it darkSpark) a bit more awesome. 56 | 57 | 58 | ### Day 9 59 | +Added 60 | 1. Today I learned how to Classify MNIST-dataset images in Browser using Tensorflow.JS 61 | 62 | /\Plans: Oh boy, I am sleepy. 63 | 64 | 65 | ### Day 10 66 | +Added 67 | 1. Today I implemented the Normal Equation for Finding 'theta' in a Multi-variate Linear Regression Problem in Python using only Numpy and Pandas. 68 | 69 | /\ Plans: *This Section doesnot exist* 70 | 71 | ### Day 11 72 | +Added 73 | 1. Today, I implemented Gradient Descent Optimisation Algorithm in Python (numpy) for Optimising a given Weights Vector ('theta', in this case). 74 | 75 | /\ Plans: Unlike all other days, Tommorow I will Solve some Algorithm questions on Hackerrank (https://hackerrank.com) 76 | 77 | 78 | ### Day 12 79 | +Added 80 | 1. Today, I solved 5 Algorithms and Data Structures Problem in Python and C++ on HackerRank Website. Hence, Their are no files in Day 12 Folder; except for one indicating the same. I have maintained the Dated Folders just for consistency. 81 | 82 | /\ Plans: Don't Really know 83 | -------------------------------------------------------------------------------- /2019/tarunagarwal99/README.md: -------------------------------------------------------------------------------- 1 | * Intro 2 | * Day - 0 3 | * Day - 1 4 | -------------------------------------------------------------------------------- /2019/tash149/README.md: -------------------------------------------------------------------------------- 1 | # Tarushi Sharma 2 | * 2nd year CCE student 3 | * An ML, DL enthusiast 4 | 5 | ### Plans for 100DaysOfCode 6 | * Improving Deep Learning by doing projects 7 | * Trying out more Kaggle competitions 8 | * Improving Django 9 | * Using python to get things easily done 10 | 11 | -------------------------------------------------------------------------------- /2019/tash149/open1.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import sys 3 | 4 | cascPath = "frontalFace10/haarcascade_frontalface_default.xml" 5 | faceCascade = cv2.CascadeClassifier(cascPath) 6 | 7 | video_capture = cv2.VideoCapture(0) 8 | 9 | while True: 10 | # Capture frame-by-frame 11 | ret, frame = video_capture.read() 12 | 13 | gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 14 | 15 | faces = faceCascade.detectMultiScale( 16 | gray, 17 | scaleFactor=1.1, 18 | minNeighbors=5, 19 | minSize=(30, 30), 20 | flags = cv2.CASCADE_SCALE_IMAGE 21 | ) 22 | 23 | # Draw a rectangle around the faces 24 | for (x, y, w, h) in faces: 25 | cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2) 26 | 27 | # Display the resulting frame 28 | cv2.imshow('Video', frame) 29 | 30 | if cv2.waitKey(1) & 0xFF == ord('q'): 31 | break 32 | 33 | # When everything is done, release the capture 34 | video_capture.release() 35 | cv2.destroyAllWindows() 36 | 37 | """ 38 | import cv2 39 | import sys 40 | 41 | cascPath = sys.argv[1] 42 | faceCascade = cv2.CascadeClassifier(cascPath) 43 | 44 | video_capture = cv2.VideoCapture(0) 45 | 46 | while True: 47 | # Capture frame-by-frame 48 | ret, frame = video_capture.read() 49 | 50 | gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 51 | 52 | faces = faceCascade.detectMultiScale( 53 | gray, 54 | scaleFactor=1.1, 55 | minNeighbors=5, 56 | minSize=(30, 30), 57 | flags=cv2.cv.CV_HAAR_SCALE_IMAGE 58 | ) 59 | 60 | # Draw a rectangle around the faces 61 | for (x, y, w, h) in faces: 62 | cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2) 63 | 64 | # Display the resulting frame 65 | cv2.imshow('Video', frame) 66 | 67 | if cv2.waitKey(1) & 0xFF == ord('q'): 68 | break 69 | 70 | # When everything is done, release the capture 71 | video_capture.release() 72 | cv2.destroyAllWindows() 73 | """ -------------------------------------------------------------------------------- /2019/thameemk612/README.md: -------------------------------------------------------------------------------- 1 | # Thameem 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2019/v4vishalchauhan/README.md: -------------------------------------------------------------------------------- 1 | # Vishal Chauhan 2 | 3 | ### Day 1 4 | 5 | 6 | ### Day 2 7 | 8 | 9 | ### Day 3 10 | -------------------------------------------------------------------------------- /2020/README.md: -------------------------------------------------------------------------------- 1 | # 100DaysOfCode with PyJaipur 2 | 3 | 100 Days of Code is a self improvement tool, where you make a commitment to solve 1 coding problem everyday for the next 100 days. 4 | 5 | ## Rules 6 | 7 | - Solve 1 problem every day 8 | - Commit solutions to this repo. Use `//`. 9 | - The recommended format is to have `d1.py` etc as a filename. 10 | - Your own name is recommended to be in lowercase. Please don't use profanity; it's childish. 11 | - Each code file should contain a link to the problem you solved as the first comment. 12 | - There is no language restriction. Try to solve the problem in any language you want. 13 | 14 | 15 | ## Benefits 16 | 17 | * Coding will become a daily habit for you. 18 | * Every day that you consistently code, you’ll build momentum. That momentum will make it easier for you to learn more advanced topics. 19 | * Your GitHub profile will look extremely active. And yes, hiring managers and recruiters do look at these. 20 | * You’ll greatly diminish your fear of starting a new coding project. It will become a natural, ordinary thing to do. 21 | * You’ll have a good reason to stop procrastinating and start coding every day. 22 | 23 | ## What's the role of PyJaipur 24 | 25 | - If you are stuck on a problem, you can write a message in the [@pyjaipur](https://t.me/pyjaipur) telegram group and people will help you. 26 | - If you don't know what problem to work on, this README will be updated daily with a new problem. 27 | 28 | 29 | ## Problems 30 | 31 | - Day 01: https://leetcode.com/problems/brick-wall/ 32 | - Day 02: https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/ 33 | - Day 03: https://leetcode.com/problems/remove-comments/ 34 | - Day 04: https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ 35 | - Day 05: https://leetcode.com/problems/decrease-elements-to-make-array-zigzag/ 36 | -------------------------------------------------------------------------------- /2020/arjoonn/d1.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.com/problems/brick-wall/ 2 | 3 | 4 | class Solution: 5 | def leastBricks(self, wall: List[List[int]]) -> int: 6 | rowsums = {} 7 | most_gaps = 0 8 | for row in wall: 9 | total = 0 10 | for i in row[:-1]: # Skip the last brick 11 | total += i 12 | if total not in rowsums: 13 | rowsums[total] = 0 14 | rowsums[total] += 1 15 | most_gaps = max((rowsums[total]), most_gaps) 16 | return len(wall) - most_gaps 17 | -------------------------------------------------------------------------------- /2020/arjoonn/d2.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/ 2 | 3 | # Definition for a binary tree node. 4 | # class TreeNode: 5 | # def __init__(self, val=0, left=None, right=None): 6 | # self.val = val 7 | # self.left = left 8 | # self.right = right 9 | 10 | final_root = None 11 | 12 | 13 | def drop(node): 14 | if node.parent is None: 15 | global final_root 16 | final_root = None 17 | return 18 | if node.parent.left == node: 19 | node.parent.left = None 20 | if node.parent.right == node: 21 | node.parent.right = None 22 | 23 | 24 | def is_insufficient(node, limit): 25 | if node is None: 26 | return True 27 | if node.left is None and node.right is None: 28 | if node.sum_from_root < limit: 29 | drop(node) 30 | return True 31 | else: 32 | if node.left is not None: 33 | node.left.parent = node 34 | node.left.sum_from_root = node.left.val + node.sum_from_root 35 | if node.right is not None: 36 | node.right.parent = node 37 | node.right.sum_from_root = node.right.val + node.sum_from_root 38 | l = is_insufficient(node.left, limit) 39 | r = is_insufficient(node.right, limit) 40 | if l and r: 41 | drop(node) 42 | return True 43 | return False 44 | 45 | 46 | class Solution: 47 | def sufficientSubset(self, root: TreeNode, limit: int) -> TreeNode: 48 | global final_root 49 | root.sum_from_root = root.val 50 | root.parent = None 51 | final_root = root 52 | is_insufficient(root, limit) 53 | return final_root 54 | -------------------------------------------------------------------------------- /2020/arjoonn/d3.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.com/problems/remove-comments/ 2 | def fn(source): 3 | o, s, e = "//", "/*", "*/" 4 | in_block = False 5 | buf = [] 6 | for line in source: 7 | i = 0 8 | l = len(line) 9 | while i < l: 10 | c = line[i] 11 | if not in_block and c == "/" and i + 1 < l and line[i + 1] == "/": 12 | break 13 | if not in_block and c == "/" and i + 1 < l and line[i + 1] == "*": 14 | in_block = True 15 | i += 2 16 | continue 17 | if in_block and c == "*" and i + 1 < l and line[i + 1] == "/": 18 | in_block = False 19 | i += 2 20 | continue 21 | if not in_block: 22 | buf.append(c) 23 | i += 1 24 | if buf and not in_block: 25 | yield "".join(buf) 26 | buf = [] 27 | 28 | 29 | class Solution: 30 | def removeComments(self, source: List[str]) -> List[str]: 31 | return list(fn(source)) 32 | -------------------------------------------------------------------------------- /2020/arjoonn/d4.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ 2 | class Solution: 3 | def minRemoveToMakeValid(self, s: str) -> str: 4 | final = [] 5 | balance = 0 6 | i = 0 7 | oidx = list() 8 | cidx = list() 9 | while i < len(s): 10 | c = s[i] 11 | if c == "(": 12 | balance += 1 13 | oidx.append(len(final)) 14 | elif c == ")" and balance <= 0: 15 | i += 1 16 | continue 17 | elif c == ")" and balance > 0: 18 | balance -= 1 19 | cidx.append(len(final)) 20 | final.append(c) 21 | i += 1 22 | if balance < 0: # more ) than ( 23 | while balance != 0: 24 | final.pop(cidx.pop(0)) 25 | balance += 1 26 | if balance > 0: # more ( than ) 27 | while balance != 0: 28 | final.pop(oidx.pop(-1)) 29 | balance -= 1 30 | return "".join(final) 31 | -------------------------------------------------------------------------------- /2020/arjoonn/d5.py: -------------------------------------------------------------------------------- 1 | # https://leetcode.com/problems/decrease-elements-to-make-array-zigzag/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 100 days of code 2 | 3 | 1. Each year has it's own README file. Please follow them while participating. 4 | 2. To turn your name into a link in the list below: 5 | - Update `userlinks` dictionary in `update_readme.py` file. 6 | - Open a pull request. 7 | 8 | To regenerate this README file: 9 | 10 | ```bash 11 | git log | python3 update_readme.py > new 12 | mv new README.md 13 | ``` 14 | 15 | 16 | 17 | -------------- 18 | 19 | 20 | ## 2020 21 | 22 | - [arjoonn](https://www.arjoonn.com) 23 | 24 | ## 2019 25 | 26 | - akshay bengani 27 | - akshit aggarwal 28 | - alucard 29 | - arnab sinha 30 | - arnav anand 31 | - aryan dadheech 32 | - bharat purohit 33 | - carotkut94 34 | - chetan tiwari 35 | - deathcode 36 | - dhruv-gupta14 37 | - gaurav 38 | - gopalsharma05 39 | - hiteshsubnani0128 40 | - jatin assudani 41 | - karan mannan 42 | - karthikeyan 43 | - may12day 44 | - mayank devnani 45 | - mithilesh parmar 46 | - moulikcipherx 47 | - nikh-06 48 | - nitanshu vashistha 49 | - piyush agarwal 50 | - pradhvan bisht 51 | - prashant nigam 52 | - pratul kumar 53 | - prayas26 54 | - premanshu pareek 55 | - ravi k 56 | - rishabh kalakoti 57 | - rustagishubhi 58 | - sahil kharya 59 | - saksham taneja 60 | - sakshi 61 | - sarthak jain 62 | - shivank gautam 63 | - [shivank98](https://github.com/Shivank98) 64 | - shubhi rustagi 65 | - sidharth soni 66 | - soumil 67 | - tanay 68 | - tarushi sharma 69 | - varshit 70 | 71 | ## 2018 72 | 73 | - arnab sinha 74 | - aryan dadheech 75 | - deepeshm41 76 | - jains8844 77 | - mahima khandelwal 78 | - mayank devnani 79 | - nikh-06 80 | - piyush agarwal 81 | - prashant nigam 82 | - prashant0598 83 | - pratul kumar 84 | - ravi k 85 | - [shivank98](https://github.com/Shivank98) 86 | - sidharth soni 87 | - tanay mehta 88 | - tarushi sharma 89 | -------------------------------------------------------------------------------- /update_readme.py: -------------------------------------------------------------------------------- 1 | import json 2 | from collections import defaultdict 3 | 4 | userlinks = { 5 | "arjoonn": "https://www.arjoonn.com", 6 | "shivank98": "https://github.com/Shivank98", 7 | } 8 | 9 | SEP = "--------------" 10 | with open("README.md", "r") as fl: 11 | pre = fl.read().split(SEP)[0] 12 | 13 | commits = defaultdict(set) 14 | buf = {} 15 | while True: 16 | try: 17 | line = input() 18 | except EOFError: 19 | break 20 | else: 21 | if line.startswith("commit"): 22 | buf["commit"] = line.split()[1] 23 | elif line.startswith("Author"): 24 | buf["author"] = line.split("Author:")[1] 25 | elif line.startswith("Date"): 26 | buf["year"] = line.split("Date:")[1].split()[-2] 27 | commits[buf["year"]].add(buf["author"]) 28 | buf = {} 29 | print(pre, "\n") 30 | print(SEP, "\n") 31 | 32 | for year, authors in sorted(commits.items(), key=lambda x: int(x[0]), reverse=True): 33 | print(f"\n## {year}\n") 34 | authors = [author.split("<")[0].strip().lower() for author in authors] 35 | last = "" 36 | for author in sorted(authors): 37 | if last and last in author: 38 | continue 39 | last = author 40 | if author in userlinks: 41 | author = f"[{author}]({userlinks[author]})" 42 | print(f"- {author}") 43 | --------------------------------------------------------------------------------