├── .DS_Store ├── .idea ├── .gitignore ├── misc.xml ├── modules.xml └── vcs.xml ├── C++ ├── 124_BinaryTreeMaximumPathSum.cpp ├── 234. Palindrome Linked List.cpp ├── Array in C++.cpp ├── Bitwise xor of all pairings ├── BubbleSort.cpp ├── CheckLinkedListIsPalindromeOrNot.cpp ├── Count of Subsets having Maximum Possible XOR Value ├── DP_Series_Longest_common_subsequence ├── Egyptian_Fraction.cpp ├── Insertionsort.cpp ├── QuickSort.cpp ├── Radix Sort.cpp ├── RadixSort.cpp ├── SelectionSort.cpp ├── Single_Operation_Part_1.cpp ├── Valid Square.cpp ├── bubble_Sort_Code.cpp ├── cocktail_sort.cpp ├── countingSort.cpp ├── counting_Sort_Code.cpp ├── heap_sort.cpp ├── heapify.cpp ├── insertion_Sort_Code.cpp ├── kadane's algo ├── linkedListLength.cpp ├── linkedListLength.exe ├── mergeSort.cpp ├── non-negative_product.cpp ├── quicksort.cpp ├── readme.txt ├── scheduling.cpp └── selection_Sort_Code.cpp ├── DeveloperCode.iml ├── Dice Roller Simulation project ├── dice.py ├── die1.PNG ├── die2.PNG ├── die3.PNG ├── die4.PNG ├── die5.PNG └── die6.PNG ├── Gfg ├── Bubblesort.c ├── readme.txt └── squareroot.py ├── Java ├── 2D Array Addition ├── Anagram.java ├── BubbleSort.java ├── BucketSort.java ├── Calculator.java ├── CheckOddEven.java ├── Chinese_remainder_theorem ├── Combination.java ├── CountWords.java ├── Fibonnaci.java ├── Find_the_Highest_Altitude.java ├── FirstGUI.java ├── Fizz_Buzz.java ├── Hashing_Implementation.java ├── Hollow Inverted Pyramid Star ├── Josephus.java ├── JumpSearch.java ├── Kadane’s Algorithm ├── Kids_With_the_Greatest_Number_of_Candies.java ├── LongestPalindromicSubsequence.java ├── Longest_Common_Subsequence.java ├── Matrix_Diagonal_Sum.java ├── MaxInArray.java ├── Mo.java ├── Number_of_ways_in_a_maze.java ├── Occurrence_character.java ├── Rabin Karp ├── RecursivelySearch.java ├── Reverse a linked list using java ├── Reverse a stack using java ├── Roman_to_Integer.java ├── Rotate_Matrix_by_90_degree.java ├── Stair1.java ├── Stairs.java ├── Start.java ├── Student.java ├── StudentDao.java ├── Subsequence.java ├── SudokuSolver.java ├── TripletSum.java ├── Two_Sum.java ├── Valid_Palindrome.java ├── Validate_BST.java ├── Validparentheses.cpp ├── bank account.java ├── base.java ├── binaryString.java ├── binary_search.java ├── connection.java ├── designpatterns │ └── singleton │ │ ├── EagerInitializedSingleton.java │ │ ├── LazyInitializedSingleton.java │ │ ├── StaticBlockSingleton.java │ │ └── ThreadSafeSingleton.java ├── fre.java ├── huffmanEncoder.java ├── longest path in a matrix ├── maximumpathsum.java ├── numtoword ├── palindrome-number.java ├── productExceptSelf.java ├── rabinKarp.java ├── readme.txt ├── sorting │ ├── Cyclicsort.java │ └── SelectionSort.java ├── stick.java └── sum.java ├── LICENSE ├── Leetcode ├── 2442-count-number-of-distinct-integers-after-reverse-operations.java ├── 4sum.cpp ├── Alien-Dictionary.java ├── Binary Tree Right Side View ├── Container with most water.cpp ├── Find Eventual Safe states.java ├── Find Minimum in Rotated Sorted Array.cpp ├── Integer-to-roman.java ├── JewelsAndStones.java ├── Maximum Depth of Binary Tree.CPP ├── Median of Two Sorted Arrays.java ├── Medianof.java ├── MedianofTwoSortedArrays.cpp ├── Merge k Sorted Lists.java ├── MinimumWindowSubstring.java ├── Number_of_Good_Pairs.java ├── Pascals-triangle.java ├── Perfect Squares whose sum equal to n ├── Regular Expression Matching.java ├── Reverse Nodes in k-Group.java ├── ReverseInteger.java ├── Search in Rotated Sorted Array.cpp ├── SearchinRotatedSortedArray.java ├── SingleNumber.java ├── SquaresOfSortedArray.java ├── Subsets ├── The-skyline-problem.java ├── ThreeSum.java ├── Top K Frequent Words ├── TrappingRainWater │ ├── Solution.cpp │ └── Statement.md ├── editDistance.java ├── jump game2.java ├── readme.txt ├── rotate-image.java ├── satisfiability-of-equality-equations.java ├── towerofhanoi.cpp └── twoSum.java ├── Others ├── Aditya Dwivedi │ └── assets │ │ ├── css │ │ └── styles.css │ │ ├── img │ │ ├── aditya.jpeg │ │ ├── aditya1.jpeg │ │ ├── work1.jpg │ │ ├── work2.jpg │ │ ├── work3.jpg │ │ ├── work4.jpg │ │ ├── work5.jpg │ │ └── work6.jpg │ │ ├── index.html │ │ ├── js │ │ └── main.js │ │ └── scss │ │ └── styles.scss ├── Bouncerball.js ├── Codeclub │ ├── README.md │ ├── about.html │ ├── index.html │ ├── members.html │ ├── password.html │ ├── password.js │ └── styles.css ├── Game_of_Thrones │ ├── .vscode │ │ └── settings.json │ ├── Game_of_Thrones_title_card.jpg │ ├── README.md │ ├── gameofthrones-allseasons.jpg │ ├── got.jpg │ ├── index.html │ └── style.css ├── Gui Calculator │ ├── calculator.cpp │ ├── counting.cpp │ ├── guicalculator.jss │ └── guicalculators.jss ├── HandGesture │ └── main.py ├── Magazine_Website │ ├── girl.png │ ├── magazine.css │ └── magazine.html ├── Random Dvice Generator │ ├── Readme.md │ ├── logo.png │ ├── manifest.json │ ├── popup.html │ ├── random.txt │ ├── script.js │ └── style.css ├── RockPaperScissors-OpenCV │ ├── HandTrackingModule.py │ └── main.py ├── Sattyam Samania Nft preview Card Component │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── images │ │ ├── favicon-32x32.png │ │ ├── icon-clock.svg │ │ ├── icon-ethereum.svg │ │ ├── icon-view.svg │ │ ├── image-avatar.png │ │ └── image-equilibrium.jpg │ ├── index.html │ └── style.css ├── Shreeyash Garde QR code project │ ├── Readme.md │ ├── css │ │ └── styles.css │ ├── images │ │ ├── favicon-32x32.png │ │ └── qr.png │ └── index.html ├── Shreeyash Garde nft preview card │ ├── Readme.md │ ├── css │ │ └── styles.css │ ├── images │ │ ├── favicon-32x32.png │ │ ├── icon-clock.svg │ │ ├── icon-ethereum.svg │ │ ├── image-avatar.png │ │ └── image-equilibrium.jpg │ └── index.html ├── Shreeyash Garde │ ├── achievements.html │ ├── contact.html │ ├── css │ │ └── style.css │ ├── favicon.ico │ ├── index.html │ └── shreeyash.png ├── Snakes-and-Ladder │ ├── .idea │ │ ├── .gitignore │ │ ├── misc.xml │ │ ├── modules.xml │ │ ├── uiDesigner.xml │ │ └── vcs.xml │ └── src │ │ ├── Dice.java │ │ ├── ElevatorFloor.java │ │ ├── EmptyFloor.java │ │ ├── Floor.java │ │ ├── Game.java │ │ ├── KingCobraFloor.java │ │ ├── LadderFloor.java │ │ ├── Main.java │ │ ├── NormalLadderFloor.java │ │ ├── NormalSnakeFloor.java │ │ ├── Player.java │ │ └── SnakeFloor.java ├── Software Piracy Control │ ├── build.xml │ ├── build │ │ └── classes │ │ │ ├── 3.JPG │ │ │ ├── cro4ky_Yin_Yang1.jpg │ │ │ ├── frmCustomer$1.class │ │ │ ├── frmCustomer$2.class │ │ │ ├── frmCustomer.class │ │ │ ├── frmProduct$1.class │ │ │ ├── frmProduct$2.class │ │ │ ├── frmProduct.class │ │ │ ├── gg$1.class │ │ │ ├── gg$2.class │ │ │ └── gg.class │ ├── dist │ │ ├── README.TXT │ │ ├── SPC.jar │ │ └── lib │ │ │ ├── AbsoluteLayout.jar │ │ │ ├── beansbinding-1.2.1.jar │ │ │ └── sqljdbc4.jar │ ├── manifest.mf │ ├── nbproject │ │ ├── build-impl.xml │ │ ├── genfiles.properties │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ ├── private.xml │ │ │ └── profiler │ │ │ │ └── ResetResultsProfilingPoint.pp │ │ ├── project.properties │ │ └── project.xml │ └── src │ │ ├── 3.JPG │ │ ├── cro4ky_Yin_Yang1.jpg │ │ ├── frmCustomer.form │ │ ├── frmCustomer.java │ │ ├── frmProduct.form │ │ ├── frmProduct.java │ │ ├── gg.form │ │ └── gg.java ├── TechnicalDocumentationPage ├── checknDeleteLoopInLinkedList.c ├── clock │ ├── clock_script.js │ ├── clock_style.css │ └── index.html ├── digiclock.html ├── react-portfolio-final-main │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── assets │ │ ├── Images │ │ │ ├── patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg │ │ │ ├── profile-img.png │ │ │ └── spaceman.png │ │ ├── audio │ │ │ └── u-said-it-v13-1167.mp3 │ │ └── svg │ │ │ ├── anchor-solid.svg │ │ │ ├── facebook-brands.svg │ │ │ ├── github-brands.svg │ │ │ ├── laptop-code-solid.svg │ │ │ ├── link-solid.svg │ │ │ ├── palette-solid.svg │ │ │ ├── power-off-solid.svg │ │ │ ├── twitter-brands.svg │ │ │ ├── yin-yang-solid.svg │ │ │ └── youtube-brands.svg │ │ ├── components │ │ ├── AboutPage.js │ │ ├── AllSvgs.js │ │ ├── BlogComponent.js │ │ ├── BlogPage.js │ │ ├── Intro.js │ │ ├── Main.js │ │ ├── MySkillsPage.js │ │ ├── Themes.js │ │ └── WorkPage.js │ │ ├── config │ │ ├── particlesjs-config-light.json │ │ └── particlesjs-config.json │ │ ├── data │ │ ├── AllSvg.txt │ │ ├── BlogData.js │ │ ├── Text.txt │ │ └── WorkData.js │ │ ├── globalStyles.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── reportWebVitals.js │ │ ├── setupTests.js │ │ └── subComponents │ │ ├── Anchor.js │ │ ├── BigTitlte.js │ │ ├── Card.js │ │ ├── LogoComponent.js │ │ ├── ParticleComponent.js │ │ ├── PowerButton.js │ │ ├── SocialIcons.js │ │ └── SoundBar.js ├── readme.txt ├── stack-using-array.c ├── tictac_toe_game.dart ├── todo_application │ ├── .gitignore │ ├── Readme.md │ ├── components │ │ ├── Card.jsx │ │ └── Input.jsx │ ├── index.html │ ├── package.json │ ├── postcss.config.cjs │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── assets │ │ │ └── react.svg │ │ └── main.jsx │ ├── tailwind.config.cjs │ ├── vite.config.js │ └── yarn.lock └── weather app in reactJS │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── Components │ ├── Style.css │ ├── Temp.js │ └── Weathercard.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js ├── README.md └── python ├── BounceBalls.py ├── BubbleSort.py ├── Connect_Four_Game.py ├── Count The Notebook.py ├── Covid Cases Tracker.py ├── Create Time Conversion.py ├── CreateLinkedList.py ├── Daanish and Problems.py ├── Day of the Programmer.py ├── PalindormeGenerator.py ├── Sqrt-x.py ├── Typing_speed_game ├── README.md ├── speed.py └── type_speed_img.png ├── countdowntimer.py ├── pro.py ├── readme.txt ├── reverse-string.py ├── sms_using_python.py ├── sortdate.py └── turthex.py /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/.DS_Store -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /C++/124_BinaryTreeMaximumPathSum.cpp: -------------------------------------------------------------------------------- 1 | class Solution 2 | { 3 | int sum; 4 | 5 | public: 6 | int Find(TreeNode *root) 7 | { 8 | if (!root) 9 | return 0; 10 | int left = max(0, help(root->left)); 11 | int right = max(0, help(root->right)); 12 | /*** key parts : embedding the max-value-find in the recursion process ***/ 13 | sum = max(sum, left + right + root->val); 14 | /*** get the max-value-ended-at-root ***/ 15 | return max(left, right) + root->val; 16 | } 17 | int maxPathSum(TreeNode *root) 18 | { 19 | sum = INT_MIN; 20 | Find(root); 21 | return sum; 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /C++/234. Palindrome Linked List.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | ListNode *reverse(ListNode *head){ 4 | ListNode *curr=head, *next=NULL, *prev=NULL; 5 | while(curr){ 6 | next=curr->next; 7 | curr->next=prev; 8 | prev=curr; 9 | curr=next; 10 | } 11 | return head=prev; 12 | } 13 | bool isPalindrome(ListNode* head) { 14 | ListNode *curr=head, *slow=head, *fast=head; 15 | while(fast->next && fast->next->next) { 16 | slow=slow->next; 17 | fast=fast->next->next; 18 | } 19 | slow->next=reverse(slow->next); 20 | slow=slow->next; 21 | while(slow){ 22 | if(slow->val != curr->val) return 0; 23 | slow=slow->next; 24 | curr=curr->next; 25 | } 26 | return 1; 27 | } 28 | }; -------------------------------------------------------------------------------- /C++/Array in C++.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | // array declaration by specifying size 7 | int arr1[10]; 8 | 9 | // With recent C/C++ versions, we can also 10 | // declare an array of user specified size 11 | int n = 10; 12 | int arr2[n]; 13 | 14 | return 0; 15 | } 16 | 17 | // This code is contributed by bryanpratama 18 | -------------------------------------------------------------------------------- /C++/BubbleSort.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bubble sort is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, 3 | comparing each pair of adjacent items and swapping them if they are in the wrong order. 4 | 5 | -----Complexity - O(n^2)------- 6 | */ 7 | 8 | #include 9 | using namespace std; 10 | 11 | int main() 12 | { 13 | int i, j, num, temp; 14 | 15 | cout<<"Enter the value of num \n"; 16 | cin>>num; 17 | int arr[num]; 18 | printf("Enter the elements one by one \n"); 19 | for (i = 0; i < num; i++) 20 | { 21 | cin>>arr[i]; 22 | } 23 | 24 | /* Bubble sorting begins */ 25 | for (i = 0; i < num; i++) 26 | { 27 | for (j = 0; j < (num - i - 1); j++) 28 | { 29 | if (arr[j] > arr[j + 1]) 30 | { 31 | temp = arr[j]; 32 | arr[j] = arr[j + 1]; 33 | arr[j + 1] = temp; 34 | } 35 | } 36 | } 37 | 38 | cout<<"Sorted array is...\n"; 39 | for (i = 0; i < num; i++) 40 | { 41 | cout< 4 | typedef long long int ll; 5 | using namespace std; 6 | int dp[105][105]; 7 | 8 | int longest_commom_subsequence(int i,int j,string s1,string s2){ 9 | if(i<=0||j<=0){ // Base condition 10 | return 0; 11 | } 12 | if(dp[i][j]!=-1){ // if already solved the case directly return the solution 13 | return dp[i][j]; 14 | } 15 | 16 | int ans=0; 17 | 18 | ans = max(ans,longest_commom_subsequence(i-1,j,s1,s2)); 19 | ans = max(ans,longest_commom_subsequence(i,j-1,s1,s2)); 20 | ans = max(ans,longest_commom_subsequence(i-1,j-1,s1,s2)+ (s1[i-1]==s2[j-1])) ; 21 | 22 | return dp[i][j]=ans; 23 | 24 | } 25 | int main(){ 26 | memset(dp,-1,sizeof(dp)); // initializing dp value by -1 27 | int t; 28 | cin>>t; 29 | while(t--){ 30 | string test_case1,test_case2; 31 | cin>>test_case1>>test_case2; 32 | 33 | cout< 4 | using namespace std; 5 | void egyptianFraction(int n, int d) 6 | { 7 | //When Both Numerator and denominator becomes zero then we simply return; 8 | if (d == 0 || n == 0) 9 | return; 10 | if (d % n == 0) { 11 | cout << "1/" << d / n; 12 | return; 13 | } 14 | if (n % d == 0) { 15 | cout << n / d; 16 | return; 17 | } 18 | if (n > d) { 19 | cout << n / d << " + "; 20 | egyptianFraction(n % d, d); 21 | return; 22 | } 23 | int x = d / n + 1; 24 | cout << "1/" << x << " + "; 25 | egyptianFraction(n * x - d, d * x); 26 | } 27 | int main() 28 | { 29 | int numerator = 6, denominator = 14; 30 | cout << "Egyptian Fraction representation of " 31 | << numerator << "/" << denominator << " is" 32 | << endl; 33 | egyptianFraction(numerator, denominator); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /C++/Insertionsort.cpp: -------------------------------------------------------------------------------- 1 | // C++ program for insertion sort 2 | 3 | #include 4 | using namespace std; 5 | 6 | // Function to sort an array using 7 | // insertion sort 8 | void insertionSort(int arr[], int n) 9 | { 10 | int i, key, j; 11 | for (i = 1; i < n; i++) 12 | { 13 | key = arr[i]; 14 | j = i - 1; 15 | 16 | // Move elements of arr[0..i-1], 17 | // that are greater than key, to one 18 | // position ahead of their 19 | // current position 20 | while (j >= 0 && arr[j] > key) 21 | { 22 | arr[j + 1] = arr[j]; 23 | j = j - 1; 24 | } 25 | arr[j + 1] = key; 26 | } 27 | } 28 | 29 | // A utility function to print an array 30 | // of size n 31 | void printArray(int arr[], int n) 32 | { 33 | int i; 34 | for (i = 0; i < n; i++) 35 | cout << arr[i] << " "; 36 | cout << endl; 37 | } 38 | 39 | // Driver code 40 | int main() 41 | { 42 | int arr[] = { 12, 11, 13, 5, 6 }; 43 | int N = sizeof(arr) / sizeof(arr[0]); 44 | 45 | insertionSort(arr, N); 46 | printArray(arr, N); 47 | 48 | return 0; 49 | } 50 | // This is code is contributed by rathbhupendra 51 | -------------------------------------------------------------------------------- /C++/QuickSort.cpp: -------------------------------------------------------------------------------- 1 | // C++ Implementation of the Quick Sort Algorithm. 2 | #include 3 | using namespace std; 4 | 5 | int partition(int arr[], int start, int end) 6 | { 7 | 8 | int pivot = arr[start]; 9 | 10 | int count = 0; 11 | for (int i = start + 1; i <= end; i++) { 12 | if (arr[i] <= pivot) 13 | count++; 14 | } 15 | 16 | // Giving pivot element its correct position 17 | int pivotIndex = start + count; 18 | swap(arr[pivotIndex], arr[start]); 19 | 20 | // Sorting left and right parts of the pivot element 21 | int i = start, j = end; 22 | 23 | while (i < pivotIndex && j > pivotIndex) { 24 | 25 | while (arr[i] <= pivot) { 26 | i++; 27 | } 28 | 29 | while (arr[j] > pivot) { 30 | j--; 31 | } 32 | 33 | if (i < pivotIndex && j > pivotIndex) { 34 | swap(arr[i++], arr[j--]); 35 | } 36 | } 37 | 38 | return pivotIndex; 39 | } 40 | 41 | void quickSort(int arr[], int start, int end) 42 | { 43 | 44 | // base case 45 | if (start >= end) 46 | return; 47 | 48 | // partitioning the array 49 | int p = partition(arr, start, end); 50 | 51 | // Sorting the left part 52 | quickSort(arr, start, p - 1); 53 | 54 | // Sorting the right part 55 | quickSort(arr, p + 1, end); 56 | } 57 | 58 | int main() 59 | { 60 | 61 | int arr[] = { 9, 3, 4, 2, 1, 8 }; 62 | int n = 6; 63 | 64 | quickSort(arr, 0, n - 1); 65 | 66 | for (int i = 0; i < n; i++) { 67 | cout << arr[i] << " "; 68 | } 69 | 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /C++/SelectionSort.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Summary: Selection sort divides the input list into two parts: the sublist of items already sorted and the sublist of items remaining to be sorted. 3 | It proceeds by finding the smallest (or largest) element in the unsorted sublist, 4 | exchanging it with the leftmost unsorted element and moving the sublist boundaries one element to the right. 5 | 6 | -------Complexity - O(n^2)---------- 7 | */ 8 | 9 | #include 10 | using namespace std; 11 | 12 | void selsort(int n, int data[]) 13 | { 14 | int i, j, min, temp; 15 | cout<<"\nSorted List is:\n"; 16 | for(i=1;i<=n-1;i++) 17 | { 18 | min = i; 19 | for(j=i+1;j<=n;j++) 20 | { 21 | if(data[j]>size; 38 | int arr[size]; 39 | cout<<"\nEnter Elements:"; 40 | for(i=1;i<=size;i++) 41 | cin>>arr[i]; 42 | 43 | cout<<"\nUnsorted data:\n"; 44 | for(i=1;i<=size;i++) 45 | cout< 9 | using namespace std; 10 | 11 | int main() 12 | { 13 | int l, T , y ; 14 | string s; 15 | cin >> T; 16 | 17 | for (int k = 1; k <= T; k++) 18 | { 19 | 20 | cin >> l; 21 | 22 | cin >> s; 23 | 24 | y = 0; 25 | 26 | 27 | for (int j = 0; j < l; j++) 28 | { 29 | if (s[j] == '1') 30 | { 31 | y++; 32 | 33 | } 34 | else 35 | { 36 | break; 37 | } 38 | } 39 | cout << y << endl; 40 | 41 | 42 | } 43 | return 0; 44 | } -------------------------------------------------------------------------------- /C++/Valid Square.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double check(vector &p1, vector &p2) 4 | { 5 | return sqrt((p2[0]-p1[0])*(p2[0]-p1[0]) + (p2[1]-p1[1]) * (p2[1]-p1[1]) ); 6 | } 7 | 8 | bool validSquare(vector& p1, vector& p2, vector& p3, vector& p4) { 9 | vector> p = {p1,p2,p3,p4}; 10 | set st; 11 | 12 | for(int i=0;i<4;i++) 13 | { 14 | for(int j=i+1;j<4;j++) 15 | { 16 | double res = check(p[i],p[j]); 17 | if(res!=0) 18 | { 19 | st.insert(res); 20 | } 21 | else 22 | { 23 | return false; 24 | } 25 | } 26 | } 27 | return st.size()==2; 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /C++/bubble_Sort_Code.cpp: -------------------------------------------------------------------------------- 1 | // Time Complexity = O(n^2) 2 | // Space Complexity = O(1) 3 | // Idea: Take larger element to the end by repeatedly swapping the adjacent elements 4 | 5 | #include 6 | using namespace std; 7 | 8 | void bubble_sort(int a[], int n) 9 | { 10 | for (int times = 1; times < n; times++) 11 | { 12 | // Repeated swapping 13 | for (int i = 0; i < n - times; i++) 14 | { 15 | if (a[i] > a[i + 1]) // Comparing adjacent elements 16 | swap(a[i], a[i + 1]); 17 | } 18 | } 19 | } 20 | 21 | int main() 22 | { 23 | system("CLS"); 24 | int arr[] = {-12, 5, 8, 3, 0, 9, -50, -3, -2, -1}; 25 | int n = sizeof(arr) / sizeof(int); 26 | bubble_sort(arr, n); 27 | 28 | // Print Sorted Array 29 | for (auto x : arr) 30 | cout << x << " , "; 31 | 32 | return 0; 33 | } -------------------------------------------------------------------------------- /C++/cocktail_sort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/C++/cocktail_sort.cpp -------------------------------------------------------------------------------- /C++/countingSort.cpp: -------------------------------------------------------------------------------- 1 | // C++ Program for counting sort 2 | #include 3 | #include 4 | using namespace std; 5 | #define RANGE 255 6 | 7 | // The main function that sort 8 | // the given string arr[] in 9 | // alphabetical order 10 | void countSort(char arr[]) 11 | { 12 | // The output character array 13 | // that will have sorted arr 14 | char output[strlen(arr)]; 15 | 16 | // Create a count array to store count of individual 17 | // characters and initialize count array as 0 18 | int count[RANGE + 1], i; 19 | memset(count, 0, sizeof(count)); 20 | 21 | // Store count of each character 22 | for (i = 0; arr[i]; ++i) 23 | ++count[arr[i]]; 24 | 25 | // Change count[i] so that count[i] now contains actual 26 | // position of this character in output array 27 | for (i = 1; i <= RANGE; ++i) 28 | count[i] += count[i - 1]; 29 | 30 | // Build the output character array 31 | for (i = 0; arr[i]; ++i) { 32 | output[count[arr[i]] - 1] = arr[i]; 33 | --count[arr[i]]; 34 | } 35 | 36 | /* 37 | For Stable algorithm 38 | for (i = sizeof(arr)-1; i>=0; --i) 39 | { 40 | output[count[arr[i]]-1] = arr[i]; 41 | --count[arr[i]]; 42 | } 43 | 44 | For Logic : See implementation 45 | */ 46 | 47 | // Copy the output array to arr, so that arr now 48 | // contains sorted characters 49 | for (i = 0; arr[i]; ++i) 50 | arr[i] = output[i]; 51 | } 52 | 53 | // Driver code 54 | int main() 55 | { 56 | char arr[] = "geeksforgeeks"; 57 | 58 | countSort(arr); 59 | 60 | cout << "Sorted character array is " << arr; 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /C++/counting_Sort_Code.cpp: -------------------------------------------------------------------------------- 1 | // Time Complexity : O(linear + range) 'or' O(n + k) 2 | /* 3 | Counting sort is a sorting technique based on keys between a specific range. 4 | It works by counting the number of objects having distinct key values (kind of hashing). 5 | Then do some arithmetic to calculate the position of each object in the output sequence. 6 | */ 7 | 8 | #include 9 | #include 10 | using namespace std; 11 | 12 | void counting_sort(int a[], int n) 13 | { 14 | // Largest Element 15 | int largest = -1; 16 | 17 | for (int i = 0; i < n; i++) 18 | { 19 | largest = max(largest, a[i]); 20 | } 21 | 22 | // create a count array/vector 23 | vector freq(largest + 1, 0); 24 | 25 | // Update the freq array 26 | for (int i = 0; i < n; i++) 27 | { 28 | freq[a[i]]++; 29 | } 30 | 31 | // Put back the elements from freq into original array 32 | int j = 0; 33 | for (int i = 0; i <= largest; i++) 34 | { 35 | 36 | while (freq[i] > 0) 37 | { 38 | a[j] = i; 39 | freq[i]--; 40 | j++; 41 | } 42 | } 43 | return; 44 | } 45 | 46 | int main() 47 | { 48 | system("CLS"); 49 | int arr[] = {88, 97, 10, 12, 15, 1, 5, 6, 12, 5, 8}; 50 | int n = sizeof(arr) / sizeof(int); 51 | counting_sort(arr, n); 52 | for (int i = 0; i < n; i++) 53 | { 54 | cout << arr[i] << " "; 55 | } 56 | return 0; 57 | } -------------------------------------------------------------------------------- /C++/heap_sort.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | using namespace std; 5 | 6 | 7 | void heapify(int arr[], int N, int i) 8 | { 9 | 10 | 11 | int largest = i; 12 | 13 | 14 | int l = 2 * i + 1; 15 | 16 | int r = 2 * i + 2; 17 | 18 | if (l < N && arr[l] > arr[largest]) 19 | largest = l; 20 | 21 | 22 | if (r < N && arr[r] > arr[largest]) 23 | largest = r; 24 | 25 | if (largest != i) { 26 | swap(arr[i], arr[largest]); 27 | 28 | 29 | heapify(arr, N, largest); 30 | } 31 | } 32 | 33 | 34 | void heapSort(int arr[], int N) 35 | { 36 | 37 | for (int i = N / 2 - 1; i >= 0; i--) 38 | heapify(arr, N, i); 39 | 40 | 41 | for (int i = N - 1; i > 0; i--) { 42 | 43 | 44 | swap(arr[0], arr[i]); 45 | 46 | 47 | heapify(arr, i, 0); 48 | } 49 | } 50 | 51 | 52 | void printArray(int arr[], int N) 53 | { 54 | for (int i = 0; i < N; ++i) 55 | cout << arr[i] << " "; 56 | cout << "\n"; 57 | } 58 | 59 | 60 | int main() 61 | { 62 | int arr[] = { 12, 11, 13, 5, 6, 7 }; 63 | int N = sizeof(arr) / sizeof(arr[0]); 64 | 65 | heapSort(arr, N); 66 | 67 | cout << "Sorted array is \n"; 68 | printArray(arr, N); 69 | } 70 | -------------------------------------------------------------------------------- /C++/heapify.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | 5 | 6 | 7 | void heapify(int arr[], int n, int i){ 8 | 9 | int largest = i; 10 | int left = 2*i; 11 | int right = 2*i+1; 12 | 13 | if( left < n && arr[largest] < arr[left]){ 14 | largest = left; 15 | } 16 | 17 | if(right < n && arr[largest] < arr[right]){ 18 | largest = right; 19 | } 20 | 21 | if(largest != i){ 22 | swap(arr[largest], arr[i]); 23 | heapify(arr, n, largest); 24 | } 25 | } 26 | 27 | int main(){ 28 | 29 | int arr[6] = {-1, 54, 53, 55, 52, 50}; 30 | 31 | int n = 5; 32 | for(int i=n/2; i>0; i--){ 33 | heapify(arr, n, i); 34 | } 35 | 36 | 37 | 38 | cout<<"Printing he array now"< Similar to playing cards 7 | --> Insert cards in its correct position in sorted part 8 | --> Insertion Sort is a sorting algorithm that places the input element at its suitable place in each pass. 9 | */ 10 | 11 | #include 12 | using namespace std; 13 | 14 | void insertion_sort(int a[], int n) 15 | { 16 | for (int i = 1; i < n; i++) 17 | { 18 | int current = a[i]; 19 | int prev = i - 1; 20 | // loop to find the right index where the element current should be placed 21 | while (prev >= 0 and a[prev] > current) 22 | { 23 | a[prev + 1] = a[prev]; 24 | prev--; 25 | } 26 | a[prev + 1] = current; 27 | } 28 | } 29 | 30 | int main() 31 | { 32 | system("CLS"); 33 | int arr[] = {-12, 5, 8, 3, 0, 9, -50, -3, -2, -1}; 34 | int n = sizeof(arr) / sizeof(int); 35 | insertion_sort(arr, n); 36 | for (auto x : arr) 37 | cout << x << " , "; 38 | 39 | return 0; 40 | } -------------------------------------------------------------------------------- /C++/kadane's algo: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxSubArray(vector& nums) { 4 | int curr_sum=0; 5 | int max_sum=INT_MIN; 6 | for(int i=0;imax_sum){ 9 | max_sum=curr_sum; 10 | } 11 | if(curr_sum<0){ 12 | curr_sum=0; 13 | } 14 | }return max_sum; 15 | } 16 | }; 17 | 18 | // time complexity : O(n) 19 | -------------------------------------------------------------------------------- /C++/linkedListLength.cpp: -------------------------------------------------------------------------------- 1 | // finding the length of the linked list. 2 | #include 3 | using namespace std; 4 | 5 | class Node { 6 | public: 7 | int data; 8 | Node* next; 9 | }; 10 | 11 | 12 | void push(Node** head_ref, int new_data) 13 | { 14 | 15 | Node* new_node = new Node(); 16 | 17 | new_node->data = new_data; 18 | new_node->next = (*head_ref); 19 | 20 | (*head_ref) = new_node; 21 | } 22 | 23 | int getCount(Node* head) 24 | { 25 | int count = 0; 26 | Node* current = head; 27 | while (current != NULL) { 28 | count++; 29 | current = current->next; 30 | } 31 | return count; 32 | } 33 | 34 | int main() 35 | { 36 | 37 | Node* head = NULL; 38 | 39 | push(&head, 1); 40 | push(&head, 3); 41 | push(&head, 1); 42 | push(&head, 2); 43 | push(&head, 1); 44 | cout << "count of nodes is " << getCount(head); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /C++/linkedListLength.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/C++/linkedListLength.exe -------------------------------------------------------------------------------- /C++/non-negative_product.cpp: -------------------------------------------------------------------------------- 1 | //The product of all the elements of the array to be a non-negative integer. That is, it can be either 00 or positive.It cannot to be negative. 2 | //To do this,we are willing to remove some elements of the array. Determine the minimum number of elements that she we will have to remove to make the product of the array's elements non-negative. 3 | //It is for 'T' no. of cases. 4 | #include 5 | using namespace std; 6 | 7 | int main() { 8 | int t; 9 | cin>>t; 10 | while(t--) 11 | { 12 | int n; 13 | cin>>n; 14 | int c=0; 15 | int z=0; 16 | int x; 17 | for(int i=0;i>x; 20 | if(x<0) 21 | c++; 22 | if(x==0) 23 | z=1; 24 | } 25 | if(z==1 || (c%2)==0) 26 | cout<<0< 3 | using namespace std; 4 | 5 | int partition(int arr[], int start, int end) 6 | { 7 | 8 | int pivot = arr[start]; 9 | 10 | int count = 0; 11 | for (int i = start + 1; i <= end; i++) { 12 | if (arr[i] <= pivot) 13 | count++; 14 | } 15 | 16 | // Giving pivot element its correct position 17 | int pivotIndex = start + count; 18 | swap(arr[pivotIndex], arr[start]); 19 | 20 | // Sorting left and right parts of the pivot element 21 | int i = start, j = end; 22 | 23 | while (i < pivotIndex && j > pivotIndex) { 24 | 25 | while (arr[i] <= pivot) { 26 | i++; 27 | } 28 | 29 | while (arr[j] > pivot) { 30 | j--; 31 | } 32 | 33 | if (i < pivotIndex && j > pivotIndex) { 34 | swap(arr[i++], arr[j--]); 35 | } 36 | } 37 | 38 | return pivotIndex; 39 | } 40 | 41 | void quickSort(int arr[], int start, int end) 42 | { 43 | 44 | // base case 45 | if (start >= end) 46 | return; 47 | 48 | // partitioning the array 49 | int p = partition(arr, start, end); 50 | 51 | // Sorting the left part 52 | quickSort(arr, start, p - 1); 53 | 54 | // Sorting the right part 55 | quickSort(arr, p + 1, end); 56 | } 57 | 58 | int main() 59 | { 60 | 61 | int arr[] = { 9, 3, 4, 2, 1, 8 }; 62 | int n = 6; 63 | 64 | quickSort(arr, 0, n - 1); 65 | 66 | for (int i = 0; i < n; i++) { 67 | cout << arr[i] << " "; 68 | } 69 | 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /C++/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/C++/readme.txt -------------------------------------------------------------------------------- /C++/scheduling.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool canFinish(int n, vector>& pre) { 4 | unordered_map> edges; 5 | vector indegree(n, 0); 6 | for (auto i: pre) { 7 | indegree[i[0]] += 1; 8 | if (edges.count(i[1]) > 0) { 9 | edges[i[1]].push_back(i[0]); 10 | } 11 | else { 12 | vector v; 13 | v.push_back(i[0]); 14 | edges[i[1]] = v; 15 | } 16 | } 17 | queue sxx; 18 | for (int i = 0; i < n; i++) { 19 | if (indegree[i]==0) { 20 | sxx.push(i); 21 | indegree[i] = INT_MAX; 22 | } 23 | } 24 | while (sxx.size() > 0) { 25 | int ix = sxx.front(); 26 | sxx.pop(); 27 | for (auto i: edges[ix]) { 28 | indegree[i] -= 1; 29 | if (indegree[i] == 0) { 30 | sxx.push(i); 31 | indegree[i] = INT_MAX; 32 | } 33 | } 34 | } 35 | for (auto i: indegree) { 36 | if (i!=INT_MAX) 37 | return false; 38 | } 39 | return true; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /C++/selection_Sort_Code.cpp: -------------------------------------------------------------------------------- 1 | // Time Complexity = O(n^2) 2 | // Space Complexity = O(1) 3 | // Repeatedly finding the minimum element from the unsorted part and put it at the beginning 4 | 5 | #include 6 | using namespace std; 7 | 8 | void selection_sort(int a[], int n) 9 | { 10 | for (int pos = 0; pos <= n - 2; pos++) 11 | { 12 | int current = a[pos]; 13 | int min_position = pos; 14 | // find out the element 15 | for (int j = pos; j < n; j++) 16 | { 17 | if (a[j] < a[min_position]) 18 | min_position = j; 19 | } 20 | // swap outside the loop 21 | swap(a[min_position], a[pos]); 22 | } 23 | } 24 | 25 | int main() 26 | { 27 | system("CLS"); 28 | int arr[] = {-12, 5, 8, 3, 0, 9, -50, -3, -2, -1}; 29 | int n = sizeof(arr) / sizeof(int); 30 | selection_sort(arr, n); 31 | for (auto x : arr) 32 | cout << x << " , "; 33 | 34 | return 0; 35 | } -------------------------------------------------------------------------------- /DeveloperCode.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Dice Roller Simulation project/die1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die1.PNG -------------------------------------------------------------------------------- /Dice Roller Simulation project/die2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die2.PNG -------------------------------------------------------------------------------- /Dice Roller Simulation project/die3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die3.PNG -------------------------------------------------------------------------------- /Dice Roller Simulation project/die4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die4.PNG -------------------------------------------------------------------------------- /Dice Roller Simulation project/die5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die5.PNG -------------------------------------------------------------------------------- /Dice Roller Simulation project/die6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Dice Roller Simulation project/die6.PNG -------------------------------------------------------------------------------- /Gfg/Bubblesort.c: -------------------------------------------------------------------------------- 1 | // C program for implementation of Bubble sort 2 | #include 3 | 4 | void swap(int* xp, int* yp) 5 | { 6 | int temp = *xp; 7 | *xp = *yp; 8 | *yp = temp; 9 | } 10 | 11 | // A function to implement bubble sort 12 | void bubbleSort(int arr[], int n) 13 | { 14 | int i, j; 15 | for (i = 0; i < n - 1; i++) 16 | 17 | // Last i elements are already in place 18 | for (j = 0; j < n - i - 1; j++) 19 | if (arr[j] > arr[j + 1]) 20 | swap(&arr[j], &arr[j + 1]); 21 | } 22 | 23 | /* Function to print an array */ 24 | void printArray(int arr[], int size) 25 | { 26 | int i; 27 | for (i = 0; i < size; i++) 28 | printf("%d ", arr[i]); 29 | printf("\n"); 30 | } 31 | 32 | // Driver program to test above functions 33 | int main() 34 | { 35 | int arr[] = { 64, 34, 25, 12, 22, 11, 90 }; 36 | int n = sizeof(arr) / sizeof(arr[0]); 37 | bubbleSort(arr, n); 38 | printf("Sorted array: \n"); 39 | printArray(arr, n); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Gfg/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Gfg/readme.txt -------------------------------------------------------------------------------- /Gfg/squareroot.py: -------------------------------------------------------------------------------- 1 | n=int(input("please enter any number")) 2 | og=n/2 3 | ncg=(og+(n/og))/2 4 | while(og-ncg>0.00000000001): 5 | og=ncg 6 | ncg=(og+(n/og))/2 7 | print(og) 8 | 9 | -------------------------------------------------------------------------------- /Java/2D Array Addition: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Arry2DAdd { 4 | 5 | public static void main(String[] args) { 6 | Scanner sc = new Scanner(System.in); 7 | System.out.println("Enter the size of array:"); 8 | int size=sc.nextInt(); 9 | int num1[][]=new int[size][size]; 10 | int num2[][]=new int[size][size]; 11 | System.out.println("Enter numbers in array:"); 12 | for(int i=0;i arr[j + 1]) 10 | { 11 | int temp = arr[j]; 12 | arr[j] = arr[j + 1]; 13 | arr[j + 1] = temp; 14 | } 15 | } 16 | } 17 | } 18 | void printArray(int arr[]) 19 | { 20 | int n = arr.length; 21 | for (int i = 0; i < n; ++i) 22 | System.out.print(arr[i] + " "); 23 | System.out.println(); 24 | } 25 | public static void main(String args[]) 26 | { 27 | BubbleSort ob = new BubbleSort(); 28 | int arr[] = { 64, 34, 25, 12, 22, 11, 90 }; 29 | ob.bubbleSort(arr); 30 | System.out.println("Sorted array"); 31 | ob.printArray(arr); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Java/BucketSort.java: -------------------------------------------------------------------------------- 1 | // Bucket sort in Java 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | 6 | public class BucketSort { 7 | public void bucketSort(float[] arr, int n) { 8 | if (n <= 0) 9 | return; 10 | @SuppressWarnings("unchecked") 11 | ArrayList[] bucket = new ArrayList[n]; 12 | 13 | // Create empty buckets 14 | for (int i = 0; i < n; i++) 15 | bucket[i] = new ArrayList(); 16 | 17 | // Add elements into the buckets 18 | for (int i = 0; i < n; i++) { 19 | int bucketIndex = (int) arr[i] * n; 20 | bucket[bucketIndex].add(arr[i]); 21 | } 22 | 23 | // Sort the elements of each bucket 24 | for (int i = 0; i < n; i++) { 25 | Collections.sort((bucket[i])); 26 | } 27 | 28 | // Get the sorted array 29 | int index = 0; 30 | for (int i = 0; i < n; i++) { 31 | for (int j = 0, size = bucket[i].size(); j < size; j++) { 32 | arr[index++] = bucket[i].get(j); 33 | } 34 | } 35 | } 36 | 37 | // Driver code 38 | public static void main(String[] args) { 39 | BucketSort b = new BucketSort(); 40 | float[] arr = { (float) 0.42, (float) 0.32, (float) 0.33, (float) 0.52, (float) 0.37, (float) 0.47, 41 | (float) 0.51 }; 42 | b.bucketSort(arr, 7); 43 | 44 | for (float i : arr) 45 | System.out.print(i + " "); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Java/Calculator.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class BasicCalc { 4 | public static void main(String[] args) { 5 | char operator; 6 | Double number1, number2, result; 7 | Scanner input = new Scanner(System.in); 8 | System.out.println("Choose an operator: +, -, *, or /"); 9 | operator = input.next().charAt(0); 10 | System.out.println("Enter first number"); 11 | number1 = input.nextDouble(); 12 | System.out.println("Enter second number"); 13 | number2 = input.nextDouble(); 14 | switch (operator) { 15 | case '+': 16 | result = number1 + number2; 17 | System.out.println(number1 + " + " + number2 + " = " + result); 18 | break; 19 | case '-': 20 | result = number1 - number2; 21 | System.out.println(number1 + " - " + number2 + " = " + result); 22 | break; 23 | case '*': 24 | result = number1 * number2; 25 | System.out.println(number1 + " * " + number2 + " = " + result); 26 | break; 27 | case '/': 28 | result = number1 / number2; 29 | System.out.println(number1 + " / " + number2 + " = " + result); 30 | break; 31 | default: 32 | System.out.println("Invalid operator!"); 33 | break; 34 | } 35 | input.close(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Java/CheckOddEven.java: -------------------------------------------------------------------------------- 1 | public class Main{ 2 | public static void main(String args[]){ 3 | int n=10; 4 | if(n%2==0){ 5 | System.out.println("Number is Even"); 6 | }else{ 7 | System.out.println("Number is Odd"); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Java/Combination.java: -------------------------------------------------------------------------------- 1 | package DynamicProgramming; 2 | 3 | import java.util.Scanner; 4 | 5 | public class CoinChangeCombination { 6 | 7 | public static void main(String[] args) { 8 | // TODO Auto-generated method stub 9 | Scanner sc = new Scanner(System.in); 10 | int n = sc.nextInt(); 11 | int[] arr = new int[n]; 12 | for(int i =0;i list = new ArrayList(); 9 | list.add(0); 10 | int max = 0; 11 | for(int i=0;imax){ 15 | max = element; 16 | } 17 | } 18 | return max; 19 | } 20 | } -------------------------------------------------------------------------------- /Java/FirstGUI.java: -------------------------------------------------------------------------------- 1 | package SwingDemp; 2 | 3 | 4 | import javax.swing.JFrame; 5 | import javax.swing.JLabel; 6 | 7 | public class FirstGUI { 8 | public static void main(String[] args) { 9 | Abc obj = new Abc(); 10 | 11 | } 12 | } 13 | class Abc extends JFrame{ // CardLayout 14 | public Abc() { 15 | 16 | 17 | JLabel l = new JLabel("Hello World"); 18 | JLabel l1 = new JLabel("Welcome Aditya"); 19 | 20 | add(l); 21 | add(l1); 22 | setLayout(new FlowLayout()); //FlowLayout GridLayout NullLayout; 23 | setVisible(true);//obj.show(); 24 | setSize(400,400); 25 | 26 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 27 | 28 | 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Java/Fizz_Buzz.java: -------------------------------------------------------------------------------- 1 | // Leetcode - 412. Fizz Buzz 2 | // https://leetcode.com/problems/fizz-buzz/ 3 | 4 | class Solution { 5 | public List fizzBuzz(int n) { 6 | 7 | // The commented method can also be used but is a bit untidy & can be lenghty in some cases. 8 | 9 | // ArrayList answer = new ArrayList<>(); 10 | // for(int i = 1; i <= n; i++){ 11 | // if((i % 3 == 0) && (i % 5 == 0)){ 12 | // answer.add("FizzBuzz"); 13 | // }else if(i % 3 == 0){ 14 | // answer.add("Fizz"); 15 | // }else if(i % 5 == 0){ 16 | // answer.add("Buzz"); 17 | // }else{ 18 | // answer.add(String.valueOf(i)); 19 | // } 20 | // } 21 | // return answer; 22 | 23 | ArrayList answer = new ArrayList<>(); 24 | 25 | for(int i = 1; i <= n; i++){ 26 | boolean divisibleBy3 = (i % 3 == 0); 27 | boolean divisibleBy5 = (i % 5 == 0); 28 | 29 | String numAnsStr = ""; 30 | 31 | if(divisibleBy3){ 32 | numAnsStr += "Fizz"; 33 | } 34 | 35 | if(divisibleBy5){ 36 | numAnsStr += "Buzz"; 37 | } 38 | 39 | if(numAnsStr.equals("")){ 40 | numAnsStr += Integer.toString(i); 41 | } 42 | 43 | answer.add(numAnsStr); 44 | } 45 | 46 | return answer; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Java/Hollow Inverted Pyramid Star: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class HItangle 3 | { 4 | public static void main(String[] args) 5 | { 6 | Scanner sc=new Scanner(System.in); 7 | System.out.println("Enter N : "); 8 | int n=sc.nextInt(); 9 | System.out.print("Enter Symbol : "); 10 | char c = sc.next().charAt(0); 11 | for(int i=n;i>0;i--) 12 | { 13 | 14 | for(int j=1;j<=n-i;j++) 15 | 16 | { 17 | System.out.print(" "); 18 | } 19 | if(i==1 || i==n) 20 | for(int j=1;j<=i*2-1;j++) 21 | 22 | { 23 | System.out.print(c); 24 | } 25 | else 26 | { 27 | for(int j=1;j<=i*2-1;j++) 28 | 29 | { 30 | if(j==1 || j==i*2-1) 31 | System.out.print(c); 32 | else 33 | 34 | System.out.print(" "); 35 | } 36 | } 37 | System.out.println(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Java/Josephus.java: -------------------------------------------------------------------------------- 1 | public class Josephus { 2 | public static int remaining(int n, int k){ 3 | if(n==1){ 4 | return 0; 5 | } 6 | return (remaining(n-1,k)+k)%n; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Java/JumpSearch.java: -------------------------------------------------------------------------------- 1 | // Java program to implement Jump Search. 2 | 3 | 4 | public class JumpSearch 5 | { 6 | public static int jumpSearch(int[] arr, int x) 7 | { 8 | int n = arr.length; 9 | 10 | // Finding block size to be jumped 11 | int step = (int)Math.floor(Math.sqrt(n)); 12 | 13 | // Finding the block where element is 14 | // present (if it is present) 15 | int prev = 0; 16 | while (arr[Math.min(step, n)-1] < x) 17 | { 18 | prev = step; 19 | step += (int)Math.floor(Math.sqrt(n)); 20 | if (prev >= n) 21 | return -1; 22 | } 23 | 24 | // Doing a linear search for x in block 25 | // beginning with prev. 26 | while (arr[prev] < x) 27 | { 28 | prev++; 29 | 30 | // If we reached next block or end of 31 | // array, element is not present. 32 | if (prev == Math.min(step, n)) 33 | return -1; 34 | } 35 | 36 | // If element is found 37 | if (arr[prev] == x) 38 | return prev; 39 | 40 | return -1; 41 | } 42 | 43 | // Driver program to test function 44 | public static void main(String [ ] args) 45 | { 46 | int arr[] = { 0, 1, 1, 2, 3, 5, 8, 13, 21, 47 | 34, 55, 89, 144, 233, 377, 610}; 48 | int x = 55; 49 | 50 | // Find the index of 'x' using Jump Search 51 | int index = jumpSearch(arr, x); 52 | 53 | // Print the index where 'x' is located 54 | System.out.println("\nNumber " + x + 55 | " is at index " + index); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Java/Kadane’s Algorithm: -------------------------------------------------------------------------------- 1 | // Java program to print largest contiguous array sum 2 | import java.io.*; 3 | import java.util.*; 4 | 5 | class Kadane { 6 | // Driver Code 7 | public static void main(String[] args) 8 | { 9 | int[] a = { -2, -3, 4, -1, -2, 1, 5, -3 }; 10 | System.out.println("Maximum contiguous sum is " 11 | + maxSubArraySum(a)); 12 | } 13 | 14 | // Function Call 15 | static int maxSubArraySum(int a[]) 16 | { 17 | int size = a.length; 18 | int max_so_far = Integer.MIN_VALUE, max_ending_here 19 | = 0; 20 | 21 | for (int i = 0; i < size; i++) { 22 | max_ending_here = max_ending_here + a[i]; 23 | if (max_so_far < max_ending_here) 24 | max_so_far = max_ending_here; 25 | if (max_ending_here < 0) 26 | max_ending_here = 0; 27 | } 28 | return max_so_far; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Java/Kids_With_the_Greatest_Number_of_Candies.java: -------------------------------------------------------------------------------- 1 | // Leetcode - 1431. Kids With the Greatest Number of Candies 2 | // https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/ 3 | 4 | 5 | 6 | class Solution { 7 | public List kidsWithCandies(int[] candies, int extraCandies) { 8 | ArrayList list = new ArrayList(); 9 | int max = Integer.MIN_VALUE; 10 | for(int i=0;i= max){ 18 | list.add(true); 19 | }else{ 20 | list.add(false); 21 | } 22 | } 23 | 24 | return list; 25 | } 26 | } -------------------------------------------------------------------------------- /Java/LongestPalindromicSubsequence.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | class Subsequence{ 3 | public int longestPalinSubseq(String S) 4 | { 5 | StringBuilder temp = new StringBuilder(S); 6 | temp.reverse(); 7 | int length=S.length(); 8 | String rev=temp.toString(); 9 | int[][] store=new int[length+1][length+1]; 10 | for(int i=0;i<=length;i++){ 11 | for(int j=0;j<=length;j++){ 12 | if(i==0 || j==0){ 13 | store[i][j]=0; 14 | } 15 | else if(S.charAt(i-1)==rev.charAt(j-1)){ 16 | store[i][j]=1+store[i-1][j-1]; 17 | } 18 | else{ 19 | store[i][j]=Math.max(store[i-1][j],store[i][j-1]); 20 | } 21 | } 22 | } 23 | return store[length][length]; 24 | } 25 | } 26 | public class longestPalindrome { 27 | 28 | public static void main(String[] args) { 29 | Scanner in=new Scanner(System.in); 30 | System.out.println("Enter number of inputs"); 31 | int n=in.nextInt(); 32 | while(n!=0){ 33 | String s=in.next(); 34 | Subsequence obj=new Subsequence(); 35 | System.out.println(obj.longestPalinSubseq(s)); //prints length of longest subsequence for the given string 36 | } 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Java/Longest_Common_Subsequence.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | class Main{ 4 | static int lcs(String s1, String s2) { 5 | 6 | int n=s1.length(); 7 | int m=s2.length(); 8 | 9 | // Base Case is covered as we have initialized the prev and cur to 0. 10 | int prev[]=new int[m+1]; 11 | int cur[]=new int[m+1]; 12 | for(int ind1=1;ind1<=n;ind1++){ 13 | for(int ind2=1;ind2<=m;ind2++){ 14 | if(s1.charAt(ind1-1)==s2.charAt(ind2-1)) 15 | cur[ind2] = 1 + prev[ind2-1]; 16 | else 17 | cur[ind2] = 0 + Math.max(prev[ind2],cur[ind2-1]); 18 | } 19 | prev=(int[])(cur.clone()); 20 | } 21 | 22 | return prev[m]; 23 | } 24 | 25 | public static void main(String args[]) { 26 | 27 | String s1= "acd"; 28 | String s2= "ced"; 29 | 30 | System.out.println("The Length of Longest Common Subsequence is "+lcs(s1,s2)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Java/Matrix_Diagonal_Sum.java: -------------------------------------------------------------------------------- 1 | // Leetcode- 1572. Matrix Diagonal Sum 2 | // https://leetcode.com/problems/matrix-diagonal-sum/ 3 | 4 | 5 | class Solution { 6 | public int diagonalSum(int[][] mat) { 7 | int sum =0; 8 | int j=0; 9 | for(int i=0;imaxVal){ 12 | maxVal = arr[i]; 13 | } 14 | } 15 | return maxVal; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Java/Mo.java: -------------------------------------------------------------------------------- 1 | package Algorithms; 2 | import java.util.*; 3 | class Query{ 4 | int L; 5 | int R; 6 | Query(int L ,int R){ 7 | this.L = L; 8 | this.R = R; 9 | 10 | } 11 | } 12 | public class MOsAlgorithms { 13 | 14 | static void printQuerySums(int a[] , int n , ArrayList q ,int m){ 15 | // One by one compute all the Query 16 | for(int i =0;i q = new ArrayList(); 32 | q.add(new Query(0,4)); 33 | q.add(new Query(1,3)); 34 | q.add(new Query(2,4)); 35 | int m = q.size(); 36 | printQuerySums(a,n,q,m); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Java/Number_of_ways_in_a_maze.java: -------------------------------------------------------------------------------- 1 | public class Number_of_ways_in_a_Maze { 2 | public static int num_of_ways(int row, int col){ 3 | if(row==1||col==1){ 4 | return 1; 5 | } 6 | return num_of_ways(row-1,col)+num_of_ways(row,col-1); 7 | } 8 | } -------------------------------------------------------------------------------- /Java/Occurrence_character.java: -------------------------------------------------------------------------------- 1 | //Java program to count occurrence of 2 | //characters in string using Hashmap 3 | 4 | import java.util.*; 5 | public class Occurrence { 6 | static void countCharacter(String inputString) 7 | { 8 | HashMap map 9 | = new HashMap(); 10 | 11 | char[] strArray = inputString.toCharArray(); 12 | 13 | for (char c : strArray) { 14 | if (map.containsKey(c)) { 15 | 16 | map.put(c, map.get(c) + 1); 17 | } 18 | else { 19 | 20 | map.put(c, 1); 21 | } 22 | } 23 | 24 | for (Map.Entry e : map.entrySet()) { 25 | System.out.println(e.getKey() + " " + e.getValue()); 26 | } 27 | } 28 | 29 | public static void main(String[] args) 30 | { 31 | String string = "Welcome"; 32 | countCharacter(string); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Java/Reverse a linked list using java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class LinkedListTest2 { 4 | public static void main(String[] args) 5 | { 6 | // Declaring linkedlist without any initial size 7 | LinkedList linkedli = new LinkedList(); 8 | 9 | // Appending elements at the end of the list 10 | linkedli.add(new Integer(1)); 11 | linkedli.add(new Integer(2)); 12 | linkedli.add(new Integer(3)); 13 | linkedli.add(new Integer(4)); 14 | linkedli.add(new Integer(5)); 15 | System.out.print("Elements before reversing: " + linkedli); 16 | 17 | // Calling user defined function for reversing 18 | linkedli = reverseLinkedList(linkedli); 19 | System.out.print("\nElements after reversing: " + linkedli); 20 | } 21 | 22 | // Takes a linkedlist as a parameter and returns a reversed linkedlist 23 | public static LinkedList reverseLinkedList(LinkedList llist) 24 | { 25 | for (int i = 0; i < llist.size() / 2; i++) { 26 | Integer temp = llist.get(i); 27 | llist.set(i, llist.get(llist.size() - i - 1)); 28 | llist.set(llist.size() - i - 1, temp); 29 | } 30 | 31 | // Return the reversed arraylist 32 | return llist; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Java/Rotate_Matrix_by_90_degree.java: -------------------------------------------------------------------------------- 1 | //You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). 2 | //https://leetcode.com/problems/rotate-image/ 3 | 4 | public class Rotate_Matrix_by_90_degree { 5 | 6 | public static int[][] transpose(int [][] ary){ 7 | int rows=ary.length; 8 | for (int i=0;i= 0;i--) { 20 | if(arr[i]>0) { 21 | int min = Integer.MAX_VALUE; 22 | for(int j =0;j<=arr.length && i+j < dp.length;j++) { 23 | if(dp[i+j]!=null) { 24 | min = Math.min(min, dp[i+j]); 25 | } 26 | } 27 | if(min != Integer.MAX_VALUE) { 28 | dp[i] = min+1; 29 | } 30 | } 31 | } 32 | System.out.println(dp[0]); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Java/Stairs.java: -------------------------------------------------------------------------------- 1 | package DynamicProgramming; 2 | import java.util.*; 3 | public class ClimbStairs { 4 | 5 | public static void main(String[] args) { 6 | // TODO Auto-generated method stub 7 | //By using Dynamic Programming 8 | Scanner sc = new Scanner(System.in); 9 | int n = sc.nextInt(); 10 | //int cp = countPath(n,new int[n+1]); 11 | int cp = countPathTabulation(n); 12 | System.out.println(cp); 13 | } 14 | 15 | public static int countPath(int n , int[] qb) { 16 | 17 | if(n==0) { 18 | return 1; 19 | }else if(n<0) { 20 | return 0; 21 | } 22 | 23 | if(qb[n] > 0) { 24 | return qb[n]; 25 | } 26 | 27 | int nm1 = countPath(n-1,qb); 28 | int nm2 = countPath(n-2,qb); 29 | int nm3 = countPath(n-3,qb); 30 | 31 | int cp = nm1+nm2+nm3; 32 | qb[n] = cp; 33 | return cp; 34 | } 35 | 36 | public static int countPathTabulation(int n) { 37 | int[] dp = new int[n+1]; 38 | dp[0] = 1; 39 | for(int i =1;i<=n;i++) { 40 | if(i==1) { 41 | dp[i] = dp[i-1]; 42 | } 43 | else if(i==2) { 44 | dp[i] = dp[i-1] +dp[i-2]; 45 | } 46 | else { 47 | dp [i] = dp[i-1] +dp[i-2] +dp[i-3]; 48 | } 49 | 50 | } 51 | return dp[n]; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Java/Subsequence.java: -------------------------------------------------------------------------------- 1 | package RecursionAndBacktracking; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Scanner; 5 | 6 | public class stringSubsequence { 7 | 8 | public static void main(String[] args) { 9 | // TODO Auto-generated method stub 10 | Scanner sc = new Scanner(System.in); 11 | String str = sc.next(); 12 | ArrayList res = getSubSequence(str); 13 | System.out.println(res); 14 | } 15 | 16 | private static ArrayList getSubSequence(String str) { 17 | // TODO Auto-generated method stub 18 | if(str.length() == 0) { 19 | ArrayList bres = new ArrayList<>(); 20 | bres.add(" "); 21 | return bres; 22 | } 23 | 24 | char ch = str.charAt(0); // a 25 | String ros = str.substring(1); //bc 26 | ArrayList rres = getSubSequence(ros); //[--,-c,b-,bc] 27 | ArrayList mres = new ArrayList<>(); 28 | for(String rstr: rres) { 29 | mres.add(""+rstr); 30 | } 31 | for(String rstr : rres) { 32 | mres.add(ch+rstr); 33 | } 34 | return mres; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Java/TripletSum.java: -------------------------------------------------------------------------------- 1 | // Java program to find triplets 2 | // in a given array whose sum 3 | // is given sum. 4 | import java.io.*; 5 | import java.util.*; 6 | 7 | class TripletSum{ 8 | 9 | // function to print 10 | // triplets with given sum 11 | static void findTriplets(int[] arr, 12 | int n, int sum) 13 | { 14 | // sort array elements 15 | Arrays.sort(arr); 16 | 17 | for (int i = 0; 18 | i < n - 1; i++) { 19 | // initialize left and right 20 | int l = i + 1; 21 | int r = n - 1; 22 | int x = arr[i]; 23 | while (l < r) { 24 | if (x + arr[l] + arr[r] == sum) { 25 | // print elements if it's 26 | // sum is given sum. 27 | System.out.println( 28 | x + " " + arr[l] + " " 29 | + arr[r]); 30 | l++; 31 | r--; 32 | } 33 | 34 | // If sum of three elements 35 | // is less than 'sum' then 36 | // increment in left 37 | else if (x + arr[l] + arr[r] < sum) 38 | l++; 39 | 40 | // if sum is greater than 41 | // given sum, then decrement 42 | // in right side 43 | else 44 | r--; 45 | } 46 | } 47 | } 48 | 49 | // Driver code 50 | public static void main(String args[]) 51 | { 52 | int[] arr = new int[] { 0, -1, 2, -3, 1 }; 53 | int sum = -2; 54 | int n = arr.length; 55 | findTriplets(arr, n, sum); 56 | } 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /Java/Two_Sum.java: -------------------------------------------------------------------------------- 1 | // 1. Two Sum 2 | // https://leetcode.com/problems/two-sum/ 3 | 4 | import java.util.HashMap; 5 | 6 | class Solution { 7 | public int[] twoSum(int[] nums, int target) { 8 | 9 | // O(n^2) Solution. 10 | 11 | // int output[] = new int[2]; 12 | // for(int i = 0; i < nums.length; i++){ 13 | // for(int j = i + 1; j < nums.length; j++){ 14 | // if(nums[i] + nums[j] == target){ 15 | // output[0] = i; 16 | // output[1] = j; 17 | // } 18 | // } 19 | // } 20 | // return output; 21 | 22 | // O(n) Solution. 23 | 24 | int output[] = new int[2]; 25 | 26 | Map map = new HashMap<>(); 27 | for(int i = 0; i < nums.length; i++){ 28 | 29 | if(map.containsKey(target - nums[i])){ 30 | output[1] = i; 31 | output[0] = map.get(target - nums[i]); 32 | return output; 33 | } 34 | 35 | map.put(nums[i], i); 36 | } 37 | return output; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Java/Valid_Palindrome.java: -------------------------------------------------------------------------------- 1 | // Leetcode - 125. Valid Palindrome 2 | // https://leetcode.com/problems/valid-palindrome/ 3 | 4 | class Solution { 5 | public boolean isPalindrome(String s) { 6 | int start = 0; 7 | int end = s.length() - 1; 8 | while(start <= end) { 9 | while(start <= end && !Character.isLetterOrDigit(s.charAt(start))) { 10 | start++; 11 | } 12 | while(start <= end && !Character.isLetterOrDigit(s.charAt(end))) { 13 | end--; 14 | } 15 | if(start <= end && Character.toLowerCase(s.charAt(start)) != Character.toLowerCase(s.charAt(end))) { 16 | return false; 17 | } 18 | start++; 19 | end--; 20 | } 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Java/Validate_BST.java: -------------------------------------------------------------------------------- 1 | // 98. Validate Binary Search Tree 2 | // https://leetcode.com/problems/validate-binary-search-tree/ 3 | 4 | /** 5 | * Definition for a binary tree node. 6 | * public class TreeNode { 7 | * int val; 8 | * TreeNode left; 9 | * TreeNode right; 10 | * TreeNode() {} 11 | * TreeNode(int val) { this.val = val; } 12 | * TreeNode(int val, TreeNode left, TreeNode right) { 13 | * this.val = val; 14 | * this.left = left; 15 | * this.right = right; 16 | * } 17 | * } 18 | */ 19 | class Solution { 20 | public boolean isValidBST(TreeNode root) { 21 | return isValidBST(root, Long.MIN_VALUE, Long.MAX_VALUE); 22 | } 23 | 24 | public boolean isValidBST(TreeNode root, long minVal, long maxVal) { 25 | if (root == null) return true; 26 | if (root.val >= maxVal || root.val <= minVal) return false; 27 | return isValidBST(root.left, minVal, root.val) && isValidBST(root.right, root.val, maxVal); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Java/Validparentheses.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | bool isValid(string s) { 4 | stack st; 5 | for(auto i:s) 6 | { 7 | if(i=='(' or i=='{' or i=='[') st.push(i); 8 | else 9 | { 10 | if(st.empty() or (st.top()=='(' and i!=')') or (st.top()=='{' and i!='}') or (st.top()=='[' and i!=']')) return false; 11 | st.pop(); 12 | } 13 | } 14 | return st.empty(); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /Java/bank account.java: -------------------------------------------------------------------------------- 1 | class bank_account{ 2 | int account_no; 3 | String name,type; 4 | float amount; 5 | 6 | void account_details(int bank_account,String nameOfCustomer,String typeName,float amout_details){ 7 | account_no=bank_account; 8 | name=nameOfCustomer; 9 | type=typeName; 10 | amount=amout_details; 11 | } 12 | void show(){ 13 | System.out.println(account_no+" "+name+" "+type+" "+amount+" "); 14 | } 15 | void deposit(float d){ 16 | amount+=d; 17 | System.out.println("Deposit amount: "+d); 18 | } 19 | void withdraw(float d){ 20 | if(amount>d){ 21 | amount-=d; 22 | System.out.println("withdraw amount: "+d); 23 | } 24 | else{ 25 | System.out.println("Insufficient balance"); 26 | } 27 | } 28 | void get_account_balance(){ 29 | System.out.println("Your balance is: "+amount); 30 | 31 | } 32 | } 33 | class bank{ 34 | public static void main(String[] args) { 35 | bank_account n = new bank_account(); 36 | n.account_details(123456, "kritika", "saving", 1000); 37 | n.show(); 38 | n.deposit(40000); 39 | n.get_account_balance(); 40 | n.withdraw(10000); 41 | n.get_account_balance(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Java/base.java: -------------------------------------------------------------------------------- 1 | package collectionFramework; 2 | 3 | import java.util.*; 4 | import java.lang.*; 5 | import java.io.*; 6 | 7 | /* Name of the class has to be "Main" only if the class is public. */ 8 | class Codechef 9 | { 10 | public static void main (String[] args) throws java.lang.Exception 11 | { 12 | // your code goes here 13 | 14 | Scanner sc = new Scanner(System.in); 15 | int t = sc.nextInt(); 16 | while(t-->0){ 17 | int n = sc.nextInt(); 18 | int k = sc.nextInt(); 19 | sc.nextLine(); 20 | String s = sc.nextLine(); 21 | int flip = forPalindrome(s); 22 | if(flip <= k){ 23 | if(s.length() %2 == 1){ 24 | System.out.println("YES"); 25 | } 26 | else{ 27 | if((k-flip)%2 == 0){ 28 | System.out.println("YES"); 29 | }else{ 30 | System.out.println("NO"); 31 | } 32 | } 33 | } 34 | else{ 35 | System.out.println("NO"); 36 | 37 | } 38 | } 39 | sc.close(); 40 | 41 | 42 | } 43 | 44 | public static int forPalindrome(String s){ 45 | int left = 0; 46 | int right = s.length() - 1; 47 | int flip = 0; 48 | while(left < right){ 49 | for (int i =0;i= l) { 7 | int mid = l + (r - l) / 2; 8 | 9 | if (arr[mid] == x) 10 | return mid; 11 | 12 | 13 | if (arr[mid] > x) 14 | return binarySearch(arr, l, mid - 1, x); 15 | 16 | return binarySearch(arr, mid + 1, r, x); 17 | } 18 | return -1; 19 | } 20 | 21 | public static void main(String args[]) 22 | { 23 | BinarySearch ob = new BinarySearch(); 24 | int a[] = { 2, 3, 4, 10, 40 }; 25 | int n = a.length; 26 | int x = 10; 27 | int result = ob.binarySearch(a, 0, n - 1, x); 28 | if (result == -1) 29 | System.out.println("Element not present"); 30 | else 31 | System.out.println("Element found at index " 32 | + result); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Java/connection.java: -------------------------------------------------------------------------------- 1 | package com.student; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | 6 | public class CP { 7 | static Connection con; 8 | public static Connection createC() { 9 | try { 10 | 11 | //load the driver 12 | Class.forName("com.mysql.cj.jdbc.Driver"); 13 | 14 | //create the connection.. 15 | String user ="root"; 16 | String password ="Aditya9026@"; 17 | String url = "jdbc:mysql://localhost:3306/classstudent"; 18 | con = DriverManager.getConnection(url,user,password); 19 | //DriverManager.getConnection("jdbc:mysql://localhost:3306/classstudent","root","Aditya9026@"); 20 | } 21 | 22 | catch(Exception e) { 23 | e.printStackTrace(); 24 | } 25 | return con; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Java/designpatterns/singleton/EagerInitializedSingleton.java: -------------------------------------------------------------------------------- 1 | public class EagerInitializedSingleton { 2 | 3 | private static final EagerInitializedSingleton instance = new EagerInitializedSingleton(); 4 | 5 | //private constructor to avoid client applications to use constructor 6 | private EagerInitializedSingleton(){} 7 | 8 | public static EagerInitializedSingleton getInstance(){ 9 | return instance; 10 | } 11 | 12 | public void test() { 13 | System.out.println("This is Singleton instance"); 14 | } 15 | 16 | public static void main(String[] args) { 17 | EagerInitializedSingleton.getInstance().test(); 18 | } 19 | } -------------------------------------------------------------------------------- /Java/designpatterns/singleton/LazyInitializedSingleton.java: -------------------------------------------------------------------------------- 1 | public class LazyInitializedSingleton { 2 | 3 | private static LazyInitializedSingleton instance; 4 | 5 | private LazyInitializedSingleton(){} 6 | 7 | public static LazyInitializedSingleton getInstance(){ 8 | if(instance == null){ 9 | instance = new LazyInitializedSingleton(); 10 | } 11 | return instance; 12 | } 13 | 14 | public void test() { 15 | System.out.println("This is LazyInitializedSingleton instance"); 16 | } 17 | 18 | public static void main(String[] args) { 19 | LazyInitializedSingleton.getInstance().test(); 20 | } 21 | } -------------------------------------------------------------------------------- /Java/designpatterns/singleton/StaticBlockSingleton.java: -------------------------------------------------------------------------------- 1 | public class StaticBlockSingleton { 2 | 3 | private static StaticBlockSingleton instance; 4 | 5 | private StaticBlockSingleton(){} 6 | 7 | //static block initialization for exception handling 8 | static{ 9 | try{ 10 | instance = new StaticBlockSingleton(); 11 | }catch(Exception e){ 12 | throw new RuntimeException("Exception occured in creating singleton instance"); 13 | } 14 | } 15 | 16 | public static StaticBlockSingleton getInstance(){ 17 | return instance; 18 | } 19 | 20 | public void test() { 21 | System.out.println("This is StaticBlockSingleton instance"); 22 | } 23 | 24 | public static void main(String[] args) { 25 | StaticBlockSingleton.getInstance().test(); 26 | } 27 | } -------------------------------------------------------------------------------- /Java/designpatterns/singleton/ThreadSafeSingleton.java: -------------------------------------------------------------------------------- 1 | public class ThreadSafeSingleton { 2 | 3 | private static ThreadSafeSingleton instance; 4 | 5 | private ThreadSafeSingleton(){} 6 | 7 | public static synchronized ThreadSafeSingleton getInstance(){ 8 | if(instance == null){ 9 | instance = new ThreadSafeSingleton(); 10 | } 11 | return instance; 12 | } 13 | 14 | public void test() { 15 | System.out.println("This is ThreadSafeSingleton instance"); 16 | } 17 | 18 | public static void main(String[] args) { 19 | ThreadSafeSingleton.getInstance().test(); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /Java/fre.java: -------------------------------------------------------------------------------- 1 | package collectionFramework; 2 | import java.util.*; 3 | public class CutTheSticksHackerrank { 4 | public static void main(String[] args) { 5 | Scanner in = new Scanner(System.in); 6 | int n = in.nextInt(); 7 | int arr[] = new int[n]; 8 | for(int arr_i=0; arr_i < n; arr_i++){ 9 | arr[arr_i] = in.nextInt(); 10 | } 11 | 12 | int numberOfSticks = n; 13 | 14 | while(numberOfSticks>0){ 15 | 16 | System.out.println(numberOfSticks); 17 | 18 | int minPositive = 1000; 19 | 20 | for(int i = 0 ;i0){ 23 | minPositive = arr[i]; 24 | } 25 | } 26 | for(int i = 0;i 0) 20 | { 21 | 22 | r = n % 10; //getting remainder 23 | sum = (sum * 10) + r; 24 | 25 | n = n / 10; 26 | 27 | } 28 | 29 | if (temp == sum) 30 | 31 | return true; 32 | 33 | else 34 | 35 | return false; 36 | 37 | } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Java/productExceptSelf.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | 3 | // product of two arrays consisting the multiplicating their left preceders and right aheads except them 4 | 5 | class productExceptSelf { 6 | 7 | public static void main(String[] args) { 8 | int[] input = {1,-1,2,4,7,-2,8,-3}; // 9 | 10 | int[] output = products(input); 11 | 12 | System.out.println(Arrays.toString(output)); //[-2688, 2688, -1344, -672, -384, 1344, -336, 896] 13 | } 14 | 15 | static int[] products(int[] nums) { 16 | int[] left=new int[nums.length]; 17 | int[] right = new int[nums.length]; 18 | 19 | left[0]=1; 20 | right[nums.length-1]=1; 21 | for(int i=1;i=0;i--) 25 | right[i]=nums[i+1]*right[i+1]; 26 | 27 | for(int i=0;i0){ 15 | 16 | System.out.println(numberOfSticks); 17 | 18 | int minPositive = 1000; 19 | 20 | for(int i = 0 ;i0){ 23 | minPositive = arr[i]; 24 | } 25 | } 26 | for(int i = 0;i hs = new HashSet<>(); 4 | 5 | for(int n : nums) 6 | { 7 | hs.add(n); 8 | hs.add(reverse(n)); 9 | } 10 | 11 | return hs.size(); 12 | 13 | } 14 | 15 | public int reverse(int val) 16 | { 17 | int rev = 0; 18 | while(val > 0) 19 | { 20 | int ld = val % 10; 21 | rev = rev * 10 + ld; 22 | val = val/10; 23 | } 24 | return rev; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Leetcode/Binary Tree Right Side View: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector rightSideView(TreeNode* root) { 4 | map> mp; 5 | queue> q; 6 | int level=0; 7 | vector ans; 8 | if(root==NULL) 9 | return ans; 10 | q.push(make_pair(root,level)); 11 | while(!q.empty()) 12 | { 13 | pair p=q.front(); 14 | q.pop(); 15 | TreeNode* temp=p.first; 16 | level=p.second; 17 | mp[level].push_back(temp->val); 18 | if(temp->left!=NULL) 19 | q.push(make_pair(temp->left,level+1)); 20 | if(temp->right!=NULL) 21 | q.push(make_pair(temp->right,level+1)); 22 | 23 | } 24 | 25 | for(auto ii=mp.begin();ii!=mp.end();ii++) 26 | { 27 | vector res=(*ii).second; 28 | int j=res.size(); 29 | ans.push_back(res[j-1]); 30 | } 31 | return ans; 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /Leetcode/Container with most water.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxArea(vector& height) { 4 | int left = 0; 5 | int right = height.size() - 1; 6 | int maxi = 0; 7 | while(left < right){ 8 | int w = right - left; 9 | int h = min(height[left], height[right]); 10 | int area = h * w; 11 | maxi = max(maxi, area); 12 | if(height[left] < height[right]) left++; 13 | else if(height[left] > height[right]) right--; 14 | else { 15 | left++; 16 | right--; 17 | } 18 | } 19 | return maxi; 20 | } 21 | }; -------------------------------------------------------------------------------- /Leetcode/Find Eventual Safe states.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public boolean canFinish(int numCourses, int[][] prerequisites) { 3 | 4 | ArrayList [] graph = new ArrayList[numCourses]; 5 | for(int i =0;i(); 7 | } 8 | for(int i =0;i [] graph,boolean [] visited,boolean [] dfsvisited){ 30 | visited[node]=true; 31 | dfsvisited[node]=true; 32 | 33 | for(int nbrs:graph[node]){ 34 | if(visited[nbrs]==false){ 35 | if(isCyclic(nbrs,graph,visited,dfsvisited)){ 36 | return true; 37 | } 38 | } 39 | else if(dfsvisited [nbrs]==true) 40 | return true; 41 | } 42 | dfsvisited[node]=false; 43 | return false; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /Leetcode/Find Minimum in Rotated Sorted Array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Problem Link: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ 5 | 6 | class Solution { 7 | public: 8 | int findMin(vector& nums) { 9 | if (nums.size() == 1) return nums[0]; 10 | if (nums[nums.size()-1] > nums[0]) return nums[0]; 11 | 12 | int l=0,r=nums.size()-1,mid; 13 | while (l 0 && nums[mid] < nums[mid-1]) return nums[mid]; 16 | if (mid < nums.size() - 1 && nums[mid+1] < nums[mid]) return nums[mid+1]; 17 | 18 | if (nums[mid] > nums[0]) l = mid+1; 19 | else r = mid-1; 20 | } 21 | 22 | return nums[l]; 23 | } 24 | }; -------------------------------------------------------------------------------- /Leetcode/Integer-to-roman.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public String intToRoman(int num) { 3 | int[] values = {1000,900,500,400,100,90,50,40,10,9,5,4,1}; 4 | String[] strs = {"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"}; 5 | 6 | StringBuilder sb = new StringBuilder(); 7 | 8 | for(int i=0;i= values[i]) { 10 | num -= values[i]; 11 | sb.append(strs[i]); 12 | } 13 | } 14 | return sb.toString(); 15 | } 16 | } -------------------------------------------------------------------------------- /Leetcode/JewelsAndStones.java: -------------------------------------------------------------------------------- 1 | //Problem Link:- https://leetcode.com/problems/jewels-and-stones/ 2 | 3 | //Problem Solution in Java: 4 | 5 | class Solution { 6 | public int numJewelsInStones(String jewels, String stones) { 7 | int count=0; 8 | for(int i=0;ileft); 19 | int t=maxDepth(root->right); 20 | 21 | return 1 + max(c,t); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /Leetcode/Median of Two Sorted Arrays.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public double findMedianSortedArrays(int[] nums1, int[] nums2) { 3 | if(nums1.length > nums2.length) 4 | return findMedianSortedArrays(nums2,nums1); 5 | 6 | int x = nums1.length; 7 | int y = nums2.length; 8 | int low = 0; 9 | int high = x; 10 | 11 | while(low<=high){ 12 | int partX = (low+high)/2; 13 | int partY = (x+y+1)/2 - partX;//x+y+1 (+1 is to handle odd length ) 14 | int xLeft = partX == 0 ? Integer.MIN_VALUE : nums1[partX-1]; 15 | int xRight = partX == x ? Integer.MAX_VALUE : nums1[partX]; 16 | int yLeft = partY == 0 ? Integer.MIN_VALUE : nums2[partY-1]; 17 | int yRight = partY == y ? Integer.MAX_VALUE : nums2[partY]; 18 | 19 | if(xLeft<=yRight && yLeft<=xRight){ 20 | if((x+y)%2==0){ 21 | return ((double)Math.max(xLeft,yLeft) + Math.min(xRight,yRight))/2; 22 | }else{ 23 | return Math.max(xLeft,yLeft); 24 | } 25 | }else if(xLeft>yRight){ 26 | high = partX -1; 27 | }else{ 28 | low = partX+1; 29 | } 30 | } 31 | return 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Leetcode/Medianof.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public double findMedianSortedArrays(int[] nums1, int[] nums2) { 3 | int a = nums1.length; 4 | int b = nums2.length; 5 | int c = a+b; 6 | int[] c1 = new int[c]; 7 | System.arraycopy(nums1,0,c1,0,a); 8 | System.arraycopy(nums2,0,c1,a,b); 9 | Arrays.toString(c1); 10 | Arrays.sort(c1); 11 | 12 | if ( (c & 1) == 1 ) 13 | return (double) c1[c>>1]; 14 | else { 15 | return (c1[(c>>1) - 1] / 2.0) + (c1[c>>1] / 2.0); 16 | } 17 | 18 | // return c; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Leetcode/MedianofTwoSortedArrays.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double findMedianSortedArrays(vector& nums1, vector& nums2) { 4 | vectortemp; 5 | if(nums1.size()>=1){ 6 | for(int i=0;i=1){ 12 | for(int i=0;i1){ 23 | if(temp.size()%2==0){ 24 | return d; 25 | } 26 | else 27 | return temp[mid]; 28 | } 29 | 30 | else{ 31 | return temp[0]; 32 | } 33 | } 34 | }; -------------------------------------------------------------------------------- /Leetcode/Merge k Sorted Lists.java: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Leetcode/MinimumWindowSubstring.java: -------------------------------------------------------------------------------- 1 | /*https://leetcode.com/problems/minimum-window-substring/*/ */ 2 | class Solution { 3 | public String minWindow(String s, String t) { 4 | int[] map=new int[128]; 5 | for(int i=0;i0) 13 | counter--; 14 | map[ch]--; 15 | 16 | end++; 17 | while(counter==0){ 18 | if(mini>end-start){ 19 | mini=end-start; 20 | minLeft=start; 21 | } 22 | char ch2 = s.charAt(start); 23 | map[ch2]++; 24 | if(map[ch2]>0) counter++; 25 | start++; 26 | 27 | } 28 | } 29 | return mini==Integer.MAX_VALUE?"":s.substring(minLeft,minLeft+mini); 30 | } 31 | } -------------------------------------------------------------------------------- /Leetcode/Number_of_Good_Pairs.java: -------------------------------------------------------------------------------- 1 | // Java question with proper link 2 | // Leetcode - 1512. Number of Good Pairs 3 | // https://leetcode.com/problems/number-of-good-pairs/ 4 | 5 | 6 | // Solution - 7 | 8 | class Solution { 9 | public int numIdenticalPairs(int[] nums) { 10 | int sum =0; 11 | for(int i=0;i> generate(int numRows) { 3 | List> ans=new ArrayList<>(); 4 | List list=new ArrayList<>(); 5 | list.add(1); 6 | int i=1; 7 | ans.add(list); 8 | while(i list2=new ArrayList<>(); 10 | list2.add(1); 11 | for(int j=1; j=k){ 17 | curr = prev.next; 18 | next = curr.next; 19 | 20 | for(int i=1; i Integer.MAX_VALUE/10 || (rev == Integer.MAX_VALUE / 10 && pop > 7)) return 0; 8 | if (rev < Integer.MIN_VALUE/10 || (rev == Integer.MIN_VALUE / 10 && pop < -8)) return 0; 9 | rev = rev * 10 + pop; 10 | } 11 | return rev; 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Leetcode/Search in Rotated Sorted Array.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Problem Link: https://leetcode.com/problems/search-in-rotated-sorted-array/ 5 | 6 | class Solution { 7 | int findMin(vector& nums) { 8 | if (nums.size() == 1) return 0; 9 | if (nums[nums.size()-1] > nums[0]) return 0; 10 | 11 | int l=0,r=nums.size()-1,mid; 12 | while (l 0 && nums[mid] < nums[mid-1]) return mid; 15 | if (mid < nums.size() - 1 && nums[mid+1] < nums[mid]) return mid+1; 16 | 17 | if (nums[mid] > nums[0]) l = mid+1; 18 | else r = mid-1; 19 | } 20 | 21 | return l; 22 | } 23 | int binSearch(vector& nums,int l, int r, int target) { 24 | while (l<=r) { 25 | int mid = (l+r)/2; 26 | if (target == nums[mid]) return mid; 27 | if (target > nums[mid]) l = mid+1; 28 | else r = mid-1; 29 | } 30 | return -1; 31 | } 32 | public: 33 | int search(vector& nums, int target) { 34 | int min = findMin(nums); 35 | if (target < nums[min] || (min > 0 && target > nums[min-1])) return -1; 36 | 37 | if (min == 0) return binSearch(nums,0,nums.size()-1,target); 38 | if (target >= nums[0]) return binSearch(nums,0,min-1,target); 39 | return binSearch(nums,min,nums.size()-1,target); 40 | } 41 | }; -------------------------------------------------------------------------------- /Leetcode/SingleNumber.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public int singleNumber(int[] nums) { 3 | int no = nums[0]; 4 | for(int i=1; i=0 && nums[k]>key){ 15 | nums[k+1] = nums[k]; 16 | k=k-1; 17 | } 18 | nums[k+1] = key; 19 | } 20 | return nums; 21 | } 22 | } -------------------------------------------------------------------------------- /Leetcode/Subsets: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> subsets(vector& nums) { 4 | vector> ans; 5 | int n=nums.size(); 6 | 7 | for(int i=0; i<(1<v; 10 | for(int j=0; j> getSkyline(int[][] buildings) { 3 | List> list = new ArrayList<>(); 4 | 5 | List lines = new ArrayList<>(); 6 | for (int[] building: buildings) { 7 | lines.add(new int[] {building[0], building[2]}); 8 | lines.add(new int[] {building[1], -building[2]}); 9 | } 10 | Collections.sort(lines, (a, b)->a[0]==b[0]?b[1]-a[1]:a[0]-b[0]); 11 | TreeMap map = new TreeMap<>(); 12 | map.put(0, 1); 13 | int prev=0; 14 | for (int[] line: lines) { 15 | if (line[1]>0) { 16 | map.put(line[1], map.getOrDefault(line[1], 0)+1); 17 | } else { 18 | int f = map.get(-line[1]); 19 | if (f==1) map.remove(-line[1]); 20 | else map.put(-line[1], f-1); 21 | } 22 | int curr = map.lastKey(); 23 | if (curr!=prev) { 24 | list.add(Arrays.asList(line[0], curr)); 25 | prev=curr; 26 | } 27 | } 28 | return list; 29 | } 30 | } -------------------------------------------------------------------------------- /Leetcode/ThreeSum.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public List> threeSum(int[] nums) { 3 | List> result = new List<>(); 4 | int order=nums.length; 5 | for(int i=0;i sub=[i,j,k]; 10 | result.add(sub); 11 | } 12 | } 13 | } 14 | } 15 | return result; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Leetcode/Top K Frequent Words: -------------------------------------------------------------------------------- 1 | //If the freq. of the words are are different, the key having greater freq. will be at the top else if, 2 | //the freq. are same, the keys will be sorted based on their lexicographical order. 3 | bool comp(pair&p1, pair& p2){ 4 | if(p1.second==p2.second) 5 | return p1.firstp2.second; 7 | } 8 | 9 | class Solution { 10 | public: 11 | vector topKFrequent(vector& words, int k) { 12 | unordered_mapm; 13 | for(int i=0; i>v; 19 | for(auto it:m){ 20 | v.push_back(make_pair(it.first, it.second)); 21 | } 22 | 23 | //sorting the vector based on the comp() 24 | sort(v.begin(), v.end(), comp); 25 | vector res; 26 | for(int i=0; i& a) { 6 | int n = a.size(); 7 | vector pfx(n + 1), sfx(n + 1); 8 | for(int i = 0; i < n; i++) { 9 | pfx[i + 1] = max(a[i], pfx[i]); 10 | } 11 | for(int i = n - 1; i >= 0; i--) { 12 | sfx[i] = max(a[i], sfx[i + 1]); 13 | } 14 | int ans = -accumulate(a.begin(), a.end(), 0); 15 | for(int i = 0; i < n; i++) { 16 | ans += min(pfx[i + 1], sfx[i]); 17 | } 18 | return ans; 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /Leetcode/TrappingRainWater/Statement.md: -------------------------------------------------------------------------------- 1 | # 42. Trapping Rain Water 2 | 3 | ### Hard 4 | 5 | Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. 6 | 7 | ### Sample Cases 8 | 9 | 10 | Example 1: 11 | 12 | ![sample](https://assets.leetcode.com/uploads/2018/10/22/rainwatertrap.png) 13 | 14 | ``` 15 | Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] 16 | Output: 6 17 | Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. 18 | Example 2: 19 | ``` 20 | 21 | 22 | Example 2: 23 | ``` 24 | Input: height = [4,2,0,3,2,5] 25 | Output: 9 26 | ``` 27 | 28 | ### Constraints: 29 | 30 | ``` 31 | n == height.length 32 | 1 <= n <= 2 * 104 33 | 0 <= height[i] <= 105 34 | ``` 35 | -------------------------------------------------------------------------------- /Leetcode/editDistance.java: -------------------------------------------------------------------------------- 1 | //Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. 2 | //https://leetcode.com/problems/edit-distance/ 3 | 4 | //Time Complexity: O(N*M) 5 | //Space Complexity: O(M) 6 | 7 | import java.util.*; 8 | 9 | public class editDistance { 10 | 11 | static int editDist(String S1, String S2){ 12 | 13 | int n = S1.length(); 14 | int m = S2.length(); 15 | 16 | int[] prev=new int[m+1]; 17 | int[] cur=new int[m+1]; 18 | 19 | for(int j=0;j<=m;j++){ 20 | prev[j] = j; 21 | } 22 | 23 | for(int i=1;i 2 | using namespace std; 3 | void tower(int n,char src, char dest, char help){ 4 | if(n==0){ 5 | return; 6 | } 7 | tower(n-1,src,help,dest); 8 | std::cout << "move from " << src << " to " << dest<< std::endl; 9 | tower(n-1,help,dest,src); 10 | } 11 | int main() { 12 | // tower of hanoi 13 | tower(3,'a','c','b'); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /Leetcode/twoSum.java: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public int[] twoSum(int[] nums, int target) { 3 | HashMap map = new HashMap<>(); 4 | for(int i = 0;i 2 | 3 | 4 | Code Club Members Area 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 19 | 20 | 21 | 22 | 23 |
24 | 25 |
26 |

Members Area

27 |
28 | 29 |
31 |
32 | 33 |
34 |

Next Meeting:

35 |

Boss's Office.

36 |

Tuesday 6 pm.

37 |

Be there so we can be square!

38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /Others/Codeclub/password.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Enter Your Password 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 20 | 21 | 22 |
23 |

Enter your password to continue..

24 | 25 | 27 | 28 | 29 |

30 |
31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /Others/Codeclub/password.js: -------------------------------------------------------------------------------- 1 | function checkPassword() { 2 | // capture the user entered password from our input element 3 | var passwordBoxObject= 4 | document.getElementById("passwordBox()"); 5 | var passwordEntered= 6 | passwordBoxObject.value; 7 | console.log("User entered password: ", passwordEntered); 8 | // check if the password is correct 9 | var sitePassword="codeclub"; 10 | if(passwordEntered==sitePassword){ 11 | //allow navigation 12 | console.log("Allow"); 13 | window.location.assign("members.html"); 14 | }else{ 15 | //block navigation 16 | console.log("Block!"); 17 | 18 | //add a new style rule to the incorrect-password element 19 | document.getElementById("incorrect-password").style.color="red"; 20 | 21 | //add text to the incorrect-password element 22 | document.getElementById("incorrect-password").innerHTML="Incorrect password,pls try again.."; 23 | 24 | } 25 | //allow or block user navigation to the members page 26 | } 27 | -------------------------------------------------------------------------------- /Others/Game_of_Thrones/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /Others/Game_of_Thrones/Game_of_Thrones_title_card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Game_of_Thrones/Game_of_Thrones_title_card.jpg -------------------------------------------------------------------------------- /Others/Game_of_Thrones/README.md: -------------------------------------------------------------------------------- 1 | # Game Of Thrones 2 | This Serves as a mini-wiki page for game of thrones and it is made using plain html,css 3 | ![IMAGE](https://user-images.githubusercontent.com/101446457/197311286-3ec4a581-a844-4fd5-8029-efc1d6e84548.png) 4 | [RUNNING VIDEO](https://sendspark.com/share/6w2hunkuxubpljl4) 5 | 6 | [CLICK HERE TO ACCESS IT](https://targithu.github.io/silicon_maze_wiki/) 7 | 8 | -------------------------------------------------------------------------------- /Others/Game_of_Thrones/gameofthrones-allseasons.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Game_of_Thrones/gameofthrones-allseasons.jpg -------------------------------------------------------------------------------- /Others/Game_of_Thrones/got.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Game_of_Thrones/got.jpg -------------------------------------------------------------------------------- /Others/Game_of_Thrones/style.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin:0 ; 3 | padding:0; 4 | max-height: 100%; 5 | } 6 | body{ 7 | opacity: 1; 8 | background-size: contain; 9 | background-repeat: no-repeat; 10 | background-position:absolute; 11 | background: url('Game_of_Thrones_title_card.jpg') no-repeat center center/cover; 12 | height: 100vh; 13 | max-width: 100%;} 14 | 15 | .container:hover{ 16 | border-radius: 25px; 17 | border:4px solid rgb(255, 251, 0); 18 | opacity: 0.7; 19 | background-color: rgb(255, 255, 255); 20 | height: 100vh; 21 | max-width: 70%; 22 | } 23 | .container{ 24 | color: rgb(224, 235, 17); 25 | opacity:1; 26 | font-size: large; 27 | font-weight:bolder; 28 | height: 100vh; 29 | max-width: 70%; 30 | } 31 | .container1:hover{ 32 | opacity:1; 33 | color: rgb(8, 8, 8); 34 | font-size: large; 35 | font-weight:bolder; 36 | height: 100vh; 37 | max-width: 100%; 38 | } 39 | @keyframes start{ 40 | from{background-image:url("gameofthrones-allseasons.jpg");} to {background-image:url("got.jpg");} 41 | } 42 | .container3{ 43 | border:2px solid rgb(52, 8, 8); 44 | padding:3%; 45 | border-radius:25px; 46 | text-shadow: 1px 1px black; 47 | display: flex; 48 | justify-content: center; 49 | align-items: center; 50 | animation-name: start; 51 | animation-duration: 8s; 52 | } 53 | .container3:hover{ 54 | border:2px solid rgb(255, 249, 249); 55 | border-radius:25px; 56 | display: flex; 57 | justify-content: center; 58 | align-items: center; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Others/Gui Calculator/calculator.cpp: -------------------------------------------------------------------------------- 1 | # include 2 | using namespace std; 3 | 4 | int main() { 5 | 6 | char op; 7 | float num1, num2; 8 | 9 | cout << "Enter operator: +, -, *, /: "; 10 | cin >> op; 11 | 12 | cout << "Enter two operands: "; 13 | cin >> num1 >> num2; 14 | 15 | switch(op) { 16 | 17 | case '+': 18 | cout << num1 << " + " << num2 << " = " << num1 + num2; 19 | break; 20 | 21 | case '-': 22 | cout << num1 << " - " << num2 << " = " << num1 - num2; 23 | break; 24 | 25 | case '*': 26 | cout << num1 << " * " << num2 << " = " << num1 * num2; 27 | break; 28 | 29 | case '/': 30 | cout << num1 << " / " << num2 << " = " << num1 / num2; 31 | break; 32 | 33 | default: 34 | // If the operator is other than +, -, * or /, error message is shown 35 | cout << "Error! operator is not correct"; 36 | break; 37 | } 38 | 39 | return 0; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Others/Gui Calculator/counting.cpp: -------------------------------------------------------------------------------- 1 | // C++ Program for counting sort 2 | #include 3 | #include 4 | using namespace std; 5 | #define RANGE 255 6 | 7 | // The main function that sort 8 | // the given string arr[] in 9 | // alphabetical order 10 | void countSort(char arr[]) 11 | { 12 | // The output character array 13 | // that will have sorted arr 14 | char output[strlen(arr)]; 15 | 16 | // Create a count array to store count of individual 17 | // characters and initialize count array as 0 18 | int count[RANGE + 1], i; 19 | memset(count, 0, sizeof(count)); 20 | 21 | // Store count of each character 22 | for (i = 0; arr[i]; ++i) 23 | ++count[arr[i]]; 24 | 25 | // Change count[i] so that count[i] now contains actual 26 | // position of this character in output array 27 | for (i = 1; i <= RANGE; ++i) 28 | count[i] += count[i - 1]; 29 | 30 | // Build the output character array 31 | for (i = 0; arr[i]; ++i) { 32 | output[count[arr[i]] - 1] = arr[i]; 33 | --count[arr[i]]; 34 | } 35 | 36 | /* 37 | For Stable algorithm 38 | for (i = sizeof(arr)-1; i>=0; --i) 39 | { 40 | output[count[arr[i]]-1] = arr[i]; 41 | --count[arr[i]]; 42 | } 43 | 44 | For Logic : See implementation 45 | */ 46 | 47 | // Copy the output array to arr, so that arr now 48 | // contains sorted characters 49 | for (i = 0; arr[i]; ++i) 50 | arr[i] = output[i]; 51 | } 52 | 53 | // Driver code 54 | int main() 55 | { 56 | char arr[] = "geeksforgeeks"; 57 | 58 | countSort(arr); 59 | 60 | cout << "Sorted character array is " << arr; 61 | return 0; 62 | } 63 | 64 | // This code is contributed by rathbhupendra 65 | -------------------------------------------------------------------------------- /Others/HandGesture/main.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | from cvzone.HandTrackingModule import HandDetector 3 | 4 | cap=cv2.VideoCapture(0) 5 | detector=HandDetector(detectionCon=0.8, maxHands=2) 6 | 7 | while True: 8 | success, img= cap.read() 9 | hands,img = detector.findHands(img) 10 | 11 | if hands: 12 | #Hand 1 13 | hand1=hands[0] 14 | lmList1 = hand1["lmList"] #List of 21 Landmarks points 15 | bbox1=hand1["bbox"] #Bounding Box info x,y,w,h 16 | centerPoint1 = hand1["center"] #center of the hand cx,cy 17 | handType1=hand1["type"] #Hand Type Left or Right 18 | 19 | print(len(lmList1),lmList1) 20 | 21 | cv2.imshow("Image",img) 22 | cv2.waitKey(1) 23 | -------------------------------------------------------------------------------- /Others/Magazine_Website/girl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Magazine_Website/girl.png -------------------------------------------------------------------------------- /Others/Random Dvice Generator/Readme.md: -------------------------------------------------------------------------------- 1 | # Random Advice Generator 2 | 3 | ## Working Demo 4 | 5 | ![Screenshot](https://user-images.githubusercontent.com/88226411/195866994-1bf3889b-ff9f-4409-b3fc-32f036b329a9.png) 6 | -------------------------------------------------------------------------------- /Others/Random Dvice Generator/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Random Dvice Generator/logo.png -------------------------------------------------------------------------------- /Others/Random Dvice Generator/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Advice Me", 3 | "version": "1.0", 4 | "manifest_version": 2, 5 | "browser_action": { 6 | "default_popup": "popup.html", 7 | "default_icon": "./icon/logo.png" 8 | }, 9 | "icons": { 10 | "128": "./icon/logo.png" 11 | }, 12 | "permissions": ["activeTab"] 13 | } 14 | -------------------------------------------------------------------------------- /Others/Random Dvice Generator/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Advice Me 8 | 9 | 10 | 11 |

Loading...

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Others/Random Dvice Generator/random.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Random Dvice Generator/random.txt -------------------------------------------------------------------------------- /Others/Random Dvice Generator/script.js: -------------------------------------------------------------------------------- 1 | fetch('https://api.adviceslip.com/advice') 2 | .then(data => data.json()) 3 | .then(adviceData => { 4 | const adviceText = adviceData.slip.advice; 5 | const adviceElement = document.getElementById('advice'); 6 | adviceElement.innerHTML = adviceText; 7 | }) 8 | -------------------------------------------------------------------------------- /Others/Random Dvice Generator/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 250px; 3 | height: 250px; 4 | background: antiquewhite; 5 | display: flex; 6 | justify-content: center; 7 | } 8 | 9 | p { 10 | background: whitesmoke; 11 | width: auto; 12 | height: auto; 13 | margin: auto; 14 | display: flex; 15 | align-items: center; 16 | flex-direction: column; 17 | border-radius: 25px; 18 | padding: 2%; 19 | box-shadow: 10px 10px; 20 | font-size: medium; 21 | } 22 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/README.md: -------------------------------------------------------------------------------- 1 | This is the NFT Preview Card Component made by using only HTML and CSS. Here is the look: 2 | 3 | ![Screenshot (225)](https://user-images.githubusercontent.com/67833888/196836156-43db9aba-4e0f-4507-a8f3-1d88aefe4913.png) 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Sattyam Samania Nft preview Card Component/images/favicon-32x32.png -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/icon-clock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/icon-ethereum.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/icon-view.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/image-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Sattyam Samania Nft preview Card Component/images/image-avatar.png -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/images/image-equilibrium.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Sattyam Samania Nft preview Card Component/images/image-equilibrium.jpg -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Frontend Mentor | NFT preview card component 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 21 | equilibrium 22 | 23 | 24 | 25 |

Equilibrium #3429

26 | 27 |

Our Equilibrium collection promotes balance and calm.

28 | 29 |
30 |

ethereum   0.041 ETH

31 | 32 |

clock 3 days left

33 |
34 | 35 | 36 |
37 |

avtar Creation of Jules Wyvern

38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | Coded by Sattyam Samania. 47 | 48 | -------------------------------------------------------------------------------- /Others/Sattyam Samania Nft preview Card Component/style.css: -------------------------------------------------------------------------------- 1 | 2 | @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap'); 3 | 4 | 5 | body{ 6 | background-color: hsl(217, 54%, 11%); 7 | /* min-width: 100vh; */ 8 | /* display: flex; */ 9 | font-size: 18px; 10 | box-sizing: border-box; 11 | border-radius: 1px; 12 | 13 | 14 | } 15 | 16 | .container{ 17 | max-width: 300px; 18 | max-height: 300px; 19 | margin: 15% auto; 20 | 21 | } 22 | 23 | 24 | .card{ 25 | background-color: hsl(216, 50%, 16%); 26 | padding: 15px; 27 | border-radius: 10px; 28 | max-height: 540px; 29 | } 30 | 31 | .card img { 32 | width: 100%; 33 | border-radius: 10px; 34 | } 35 | 36 | .head{ 37 | color: hsl(0, 0%, 100%); 38 | } 39 | 40 | .para{ 41 | color: hsl(0, 0%, 100%); 42 | } 43 | 44 | 45 | 46 | 47 | 48 | .eth{ 49 | 50 | color: hsl(178, 100%, 50%); 51 | display: inline-flex; 52 | 53 | } 54 | 55 | 56 | 57 | 58 | .time{ 59 | float: right; 60 | color: hsl(0, 0%, 100%); 61 | 62 | } 63 | span{ 64 | color: hsl(0, 0%, 100%); 65 | } 66 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde QR code project/Readme.md: -------------------------------------------------------------------------------- 1 | # QR code component 2 | 3 | This is a QR code component made by Shreeyash Garde. 4 | ![Screenshot (5)](https://user-images.githubusercontent.com/109413920/196197642-97155724-501e-4214-8308-057b469236cf.png) 5 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde QR code project/css/styles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color:#dbe9f4; 3 | } 4 | 5 | .qr{ 6 | width:200px; 7 | height:290px; 8 | background-color: white; 9 | border-radius:10px; 10 | position: fixed; 11 | margin-top: 200px; 12 | margin-left: 650px; 13 | } 14 | 15 | .img{ 16 | height: 180px; 17 | width:180px; 18 | margin-top: 10px; 19 | margin-left: 10px; 20 | margin-right: 10px; 21 | border-radius: 10px; 22 | } 23 | h4{ 24 | 25 | margin: 10px 10px 0 10px; 26 | font-family: sans-serif; 27 | font-size: 14px; 28 | 29 | } 30 | h5{ 31 | font-size:10px; 32 | position: absolute; 33 | margin-top: 0px; 34 | color: gray; 35 | margin-left: 10px; 36 | margin-right: 10px; 37 | margin-top: 10px; 38 | font-weight: lighter; 39 | } 40 | .p{ 41 | font-size: 8px; 42 | position: absolute; 43 | margin-left: 650px; 44 | margin-top: 480px; 45 | text-align: center; 46 | font-weight: lighter; 47 | } 48 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde QR code project/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde QR code project/images/favicon-32x32.png -------------------------------------------------------------------------------- /Others/Shreeyash Garde QR code project/images/qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde QR code project/images/qr.png -------------------------------------------------------------------------------- /Others/Shreeyash Garde QR code project/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | QR code component 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 | QR code 16 |
17 |

Improve your front-end skills by building projects

18 |
Scan the QR code to visit Frontend Mentor and take your coding skills to the next level
19 |
20 |
21 |
22 |
23 |
24 |

25 | Challenge by Frontend Mentor 26 | , Created by Shreeyash garde. 27 |

28 |
29 |
30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/Readme.md: -------------------------------------------------------------------------------- 1 | # nft preview card 2 | 3 | This is a nft preview card created by Shreeyash Garde. 4 | ![Screenshot (6)](https://user-images.githubusercontent.com/109413920/196330072-180858b6-e175-42e8-8254-27f8e80b08e4.png) 5 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde nft preview card/images/favicon-32x32.png -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/images/icon-clock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/images/icon-ethereum.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/images/image-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde nft preview card/images/image-avatar.png -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/images/image-equilibrium.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde nft preview card/images/image-equilibrium.jpg -------------------------------------------------------------------------------- /Others/Shreeyash Garde nft preview card/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | nft preview card 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

0.041ETH

15 | equilibrium 16 |

Equilibrium #3429

17 |
18 |

Our Equilibrium collection promotes balance and calm.

19 | 20 |

3 days left

21 |

Creation of Jules Wyvern

22 | ethereum 23 | clock 24 |
25 |
26 | face 27 |
28 |

Coded by Shreeyash Garde

29 | 30 | 31 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde/achievements.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 27 | 30 | 31 | 32 | 35 | 38 | 39 | 40 | 43 | 46 | 47 | 48 |
15 | Year 16 | 18 | Achievements 19 |
25 | 2010 26 | 28 | Won district level karate tournament 29 |
33 | 2012 34 | 36 | Reached black belt level 1 37 |
41 | 2014 42 | 44 | Won national level budo tournament 45 |
49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Contact info

12 |
    13 |
  1. 14 |

    15 | Twitter 16 |

    17 |
  2. 18 |
  3. 19 |

    20 | Linkedin 21 |

    22 |
  4. 23 |
  5. 24 |

    25 | Github 26 |

    27 |
  6. 28 |
29 |
30 |
31 |
32 |
33 | 34 | 35 | 36 |
37 |
38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | body{ 3 | background-color: lightblue; 4 | } 5 | h1{ 6 | color : #66bfbf; 7 | } 8 | h3{ 9 | color : #66bfbf ; 10 | } 11 | 12 | 13 | 14 | hr { 15 | border-color: grey; 16 | border-width: 5px; 17 | border-style: dotted none none; 18 | width: 5%; 19 | } 20 | -------------------------------------------------------------------------------- /Others/Shreeyash Garde/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde/favicon.ico -------------------------------------------------------------------------------- /Others/Shreeyash Garde/shreeyash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Shreeyash Garde/shreeyash.png -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/Dice.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | public class Dice { 3 | private final int numFaces=2; //maximum face value 4 | private int faceValue; //current value showing on the dice 5 | // Rolls the dice 6 | public Dice(){ 7 | this.roll(); 8 | } 9 | public void roll() { 10 | Random rand= new Random(); 11 | int curr_faceValue = 1 + rand.nextInt(numFaces); 12 | setFaceValue(curr_faceValue); 13 | } 14 | 15 | // Face value setter/mutator. 16 | private void setFaceValue(int value) { 17 | if (value <= numFaces) 18 | this.faceValue = value; 19 | } 20 | 21 | // Face value getter/setter. 22 | public int getFaceValue() { 23 | return faceValue; 24 | } 25 | 26 | 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/ElevatorFloor.java: -------------------------------------------------------------------------------- 1 | public class ElevatorFloor extends LadderFloor { 2 | public ElevatorFloor(int f, int p, String s){ 3 | this.floor=f; 4 | this.points=p+4; 5 | this.name=s; 6 | this.display(); 7 | this.playerPosition(); 8 | this.totalPoints(); 9 | 10 | } 11 | 12 | public void display(){ 13 | System.out.println(name+" has reached an Elevator Floor"); 14 | } 15 | 16 | 17 | public int finalFloor() { 18 | return this.floor = 10; 19 | 20 | } 21 | 22 | 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/EmptyFloor.java: -------------------------------------------------------------------------------- 1 | public class EmptyFloor extends Floor{ 2 | private String name; 3 | public EmptyFloor(int f, int p,String n){ 4 | this.floor=f; 5 | this.points=p+1; 6 | this.name=n; 7 | this.display(); 8 | this.playerPosition(); 9 | this.totalPoints(); 10 | } 11 | public void display(){ 12 | System.out.println(name+" has reached an Empty Floor"); 13 | } 14 | 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/Floor.java: -------------------------------------------------------------------------------- 1 | public class Floor { 2 | protected int floor; 3 | protected int points; 4 | public String name; 5 | public void playerPosition(){ 6 | int _f= floor; 7 | System.out.println("Player position Floor "+_f); 8 | 9 | } 10 | 11 | 12 | public int points(){ 13 | return points; 14 | } 15 | public void totalPoints(){ 16 | System.out.println("Total Points "+ points); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/KingCobraFloor.java: -------------------------------------------------------------------------------- 1 | public class KingCobraFloor extends SnakeFloor{ 2 | 3 | private String name; 4 | 5 | public KingCobraFloor(int f, int p, String n){ 6 | this.floor=f; 7 | this.points=p-4; 8 | this.name=n; 9 | this.display(); 10 | this.playerPosition(); 11 | this.totalPoints(); 12 | } 13 | 14 | public void display(){ 15 | System.out.println(name+" has reached an King Cobra Floor"); 16 | } 17 | public int finalFloor() { 18 | return this.floor = 3; 19 | } 20 | 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/LadderFloor.java: -------------------------------------------------------------------------------- 1 | public abstract class LadderFloor extends Floor { 2 | 3 | public abstract void display() ; 4 | public abstract int finalFloor(); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | public class Main { 3 | public static void main(String[] args) { 4 | Scanner sc = new Scanner(System.in); 5 | System.out.println("Enter the player name and hit enter"); 6 | String name=sc.next(); 7 | Player p= new Player(name); 8 | 9 | System.out.println("The game setup is ready"); 10 | 11 | int diceVal; 12 | 13 | 14 | do { 15 | System.out.print("Hit enter to roll the dice "); 16 | String s=sc.nextLine(); 17 | System.out.println(s); 18 | //String k=sc.next(); 19 | 20 | Dice dice = new Dice(); 21 | diceVal=dice.getFaceValue(); 22 | if (diceVal == 1) { 23 | System.out.println("Dice gave "+ diceVal); 24 | Game _game = new Game(p); 25 | 26 | 27 | } else { 28 | System.out.println("Dice gave "+ diceVal); 29 | System.out.println("Game cannot start until you get 1"); 30 | } 31 | } while(diceVal!=1); 32 | 33 | 34 | 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/NormalLadderFloor.java: -------------------------------------------------------------------------------- 1 | public class NormalLadderFloor extends LadderFloor { 2 | public NormalLadderFloor(int f, int p, String s) { 3 | this.floor = f; 4 | this.points = p+2; 5 | this.name = s; 6 | this.display(); 7 | this.playerPosition(); 8 | this.totalPoints(); 9 | 10 | 11 | } 12 | public void display() { 13 | System.out.println(name + " has reached an Ladder Floor"); 14 | } 15 | public int finalFloor() { 16 | return this.floor = 10; 17 | 18 | } 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/NormalSnakeFloor.java: -------------------------------------------------------------------------------- 1 | public class NormalSnakeFloor extends SnakeFloor { 2 | public NormalSnakeFloor(int f, int p, String n){ 3 | this.floor=f; 4 | this.points=p-2; 5 | this.name=n; 6 | this.display(); 7 | this.playerPosition(); 8 | this.totalPoints(); 9 | } 10 | 11 | 12 | public void display(){ 13 | System.out.println(name+" has reached Snake Floor"); 14 | } 15 | 16 | public int finalFloor() { 17 | return this.floor = 1; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/Player.java: -------------------------------------------------------------------------------- 1 | public class Player { 2 | protected String name; 3 | private int points; 4 | public Player(String n){ 5 | this.name=n; 6 | } 7 | public void displayPoints(int p){ 8 | this.points=p; 9 | System.out.println(name+" accumulated "+ points+" points"); 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; } 18 | } 19 | -------------------------------------------------------------------------------- /Others/Snakes-and-Ladder/src/SnakeFloor.java: -------------------------------------------------------------------------------- 1 | public abstract class SnakeFloor extends Floor { 2 | public abstract void display() ; 3 | public abstract int finalFloor(); 4 | } 5 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/3.JPG -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/cro4ky_Yin_Yang1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/cro4ky_Yin_Yang1.jpg -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmCustomer$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmCustomer$1.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmCustomer$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmCustomer$2.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmCustomer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmCustomer.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmProduct$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmProduct$1.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmProduct$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmProduct$2.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/frmProduct.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/frmProduct.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/gg$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/gg$1.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/gg$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/gg$2.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/build/classes/gg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/build/classes/gg.class -------------------------------------------------------------------------------- /Others/Software Piracy Control/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "SPC.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, none of the 25 | classpath elements are copied to the lib folder. In such a case, 26 | you need to copy the classpath elements to the lib folder manually after the build. 27 | * If a library on the projects classpath also has a Class-Path element 28 | specified in the manifest,the content of the Class-Path element has to be on 29 | the projects runtime path. 30 | * To set a main class in a standard Java project, right-click the project node 31 | in the Projects window and choose Properties. Then click Run and enter the 32 | class name in the Main Class field. Alternatively, you can manually type the 33 | class name in the manifest Main-Class element. 34 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/dist/SPC.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/dist/SPC.jar -------------------------------------------------------------------------------- /Others/Software Piracy Control/dist/lib/AbsoluteLayout.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/dist/lib/AbsoluteLayout.jar -------------------------------------------------------------------------------- /Others/Software Piracy Control/dist/lib/beansbinding-1.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/dist/lib/beansbinding-1.2.1.jar -------------------------------------------------------------------------------- /Others/Software Piracy Control/dist/lib/sqljdbc4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/dist/lib/sqljdbc4.jar -------------------------------------------------------------------------------- /Others/Software Piracy Control/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=bc10d708 2 | build.xml.script.CRC32=11e8b7fb 3 | build.xml.stylesheet.CRC32=be360661 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=bc10d708 7 | nbproject/build-impl.xml.script.CRC32=11bb2eed 8 | nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08 9 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/private/config.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/nbproject/private/config.properties -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | file.reference.-sqljdbc_4.0=C:\\sqljdbc_4.0 5 | file.reference.sqljdbc4.jar=C:\\sqljdbc_4.0\\enu\\sqljdbc4.jar 6 | javac.debug=true 7 | javadoc.preview=true 8 | jaxws.endorsed.dir=C:\\Netbeans 6.0\\java1\\modules\\ext\\jaxws21\\api 9 | user.properties.file=C:\\Users\\Sharp\\.netbeans\\6.0\\build.properties 10 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/private/profiler/ResetResultsProfilingPoint.pp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reset Results 1 at gg:31 5 | 31 6 | true 7 | {$projectDirectory}/src/gg.java 8 | {$projectDirectory}/src/gg.java 9 | 2147483647 10 | {$projectDirectory}/src/gg.java 11 | false 12 | 2147483647 13 | fg 14 | true 15 | 31 16 | Reset Results at gg:31 17 | 31 18 | 2147483647 19 | 20 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | SPC 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Others/Software Piracy Control/src/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/src/3.JPG -------------------------------------------------------------------------------- /Others/Software Piracy Control/src/cro4ky_Yin_Yang1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/Software Piracy Control/src/cro4ky_Yin_Yang1.jpg -------------------------------------------------------------------------------- /Others/clock/clock_script.js: -------------------------------------------------------------------------------- 1 | let second_doc = document.getElementById("second"); 2 | let minute_doc = document.getElementById("minute"); 3 | let hour_doc = document.getElementById("hour"); 4 | 5 | window.setInterval(()=> { 6 | let time = new Date(); 7 | let second = time.getSeconds(), minute = time.getMinutes(), hour = time.getHours(), milliseconds = time.getMilliseconds(); 8 | if(hour > 12){ 9 | hour - 12 10 | } 11 | minute_doc.style.transform = `rotate(${(minute * 6) + (second / 10)}deg)`; 12 | minute_doc.style.display = 'block'; 13 | second_doc.style.transform = `rotate(${(second * 6) + ((milliseconds * 3) / 500)}deg)`; 14 | second_doc.style.display = 'block'; 15 | hour_doc.style.transform = `rotate(${((hour * 30) + (minute / 2) + (second /120))}deg)`; 16 | hour_doc.style.display = 'block'; 17 | }, 10) 18 | -------------------------------------------------------------------------------- /Others/clock/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Clock 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |

12

20 |

1

21 |

2

22 |

3

23 |

4

24 |

5

25 |

6

26 |

7

27 |

8

28 |

9

29 |

10

30 |

11

31 |
32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-portfolio-starter-code-files", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.14.1", 7 | "@testing-library/react": "^11.2.7", 8 | "@testing-library/user-event": "^12.8.3", 9 | "framer-motion": "^4.1.17", 10 | "normalize.css": "^8.0.1", 11 | "react": "^17.0.2", 12 | "react-dom": "^17.0.2", 13 | "react-particles-js": "^3.5.3", 14 | "react-router-dom": "^5.2.0", 15 | "styled-components": "^5.3.0", 16 | "tsparticles": "^1.31.1", 17 | "web-vitals": "^1.1.2" 18 | }, 19 | "devDependencies": { 20 | "react-scripts": "5.0.1" 21 | }, 22 | "scripts": { 23 | "start": "react-scripts start", 24 | "build": "react-scripts build", 25 | "test": "react-scripts test", 26 | "eject": "react-scripts eject" 27 | }, 28 | "eslintConfig": { 29 | "extends": [ 30 | "react-app", 31 | "react-app/jest" 32 | ] 33 | }, 34 | "browserslist": { 35 | "production": [ 36 | ">0.2%", 37 | "not dead", 38 | "not op_mini all" 39 | ], 40 | "development": [ 41 | "last 1 chrome version", 42 | "last 1 firefox version", 43 | "last 1 safari version" 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/public/favicon.ico -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/public/logo192.png -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/public/logo512.png -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/App.js: -------------------------------------------------------------------------------- 1 | import { Route, Switch, useLocation } from "react-router" 2 | import { ThemeProvider } from "styled-components" 3 | import { lightTheme } from "./components/Themes" 4 | import GlobalStyle from "./globalStyles" 5 | 6 | 7 | //Components 8 | import Main from './components/Main'; 9 | import AboutPage from './components/AboutPage'; 10 | import BlogPage from './components/BlogPage'; 11 | import WorkPage from './components/WorkPage'; 12 | import MySkillsPage from './components/MySkillsPage'; 13 | import { AnimatePresence } from "framer-motion"; 14 | import SoundBar from "./subComponents/SoundBar"; 15 | 16 | 17 | function App() { 18 | 19 | const location = useLocation(); 20 | return <> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {/* For framer-motion animation on page change! */} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | } 49 | 50 | export default App 51 | 52 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/Images/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/src/assets/Images/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/Images/profile-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/src/assets/Images/profile-img.png -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/Images/spaceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/src/assets/Images/spaceman.png -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/audio/u-said-it-v13-1167.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/react-portfolio-final-main/src/assets/audio/u-said-it-v13-1167.mp3 -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/anchor-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/facebook-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/github-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/laptop-code-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/link-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/palette-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/power-off-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/twitter-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/yin-yang-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/assets/svg/youtube-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/components/Themes.js: -------------------------------------------------------------------------------- 1 | // Here we will create dark and light theme variables 2 | 3 | export const lightTheme = { 4 | 5 | body:"#FCF6F4", 6 | text:"#000000", 7 | fontFamily:"'Source Sans Pro', sans-serif", 8 | bodyRgba : "252, 246, 244", 9 | textRgba:"0,0,0", 10 | } 11 | 12 | export const DarkTheme = { 13 | 14 | body:"#000000", 15 | text:"#FCF6F4", 16 | fontFamily:"'Source Sans Pro', sans-serif", 17 | textRgba : "252, 246, 244", 18 | bodyRgba:"0,0,0", 19 | } 20 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/globalStyles.js: -------------------------------------------------------------------------------- 1 | import { createGlobalStyle } from "styled-components"; 2 | 3 | 4 | 5 | 6 | const GlobalStyle = createGlobalStyle` 7 | 8 | *,*::before,*::after,h1,h2,h3,h4,h5,h6{ 9 | margin: 0; 10 | padding: 0; 11 | } 12 | h1,h2,h3,h4,h5,h6{ 13 | display: inline-block; 14 | } 15 | 16 | 17 | body{ 18 | margin: 0; 19 | padding: 0; 20 | overflow-x: hidden; 21 | font-family: 'Source Sans Pro',sans-serif; 22 | } 23 | 24 | ` 25 | 26 | export default GlobalStyle; -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | // import './index.css'; 4 | import App from './App'; 5 | // import reportWebVitals from './reportWebVitals'; 6 | import '../node_modules/normalize.css' 7 | import { BrowserRouter } from 'react-router-dom'; 8 | 9 | ReactDOM.render( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | , 18 | document.getElementById('root') 19 | ); 20 | 21 | // If you want to start measuring performance in your app, pass a function 22 | // to log results (for example: reportWebVitals(console.log)) 23 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 24 | // reportWebVitals(); 25 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/subComponents/BigTitlte.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | 5 | const Text = styled.h1` 6 | position: fixed; 7 | top: ${props => props.top}; 8 | left: ${props => props.left}; 9 | right: ${props => props.right}; 10 | color:${props => `rgba(${props.theme.textRgba},0.1)`}; 11 | font-size: calc(5rem + 5vw); 12 | z-index:0; 13 | 14 | ` 15 | 16 | 17 | const BigTitlte = (props) => { 18 | return ( 19 | 20 | {props.text} 21 | 22 | ) 23 | } 24 | 25 | export default BigTitlte 26 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/subComponents/LogoComponent.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { DarkTheme } from '../components/Themes' 4 | 5 | 6 | 7 | 8 | const Logo = styled.h1` 9 | display: inline-block; 10 | color: ${props => props.color === 'dark' ? DarkTheme.text : DarkTheme.body}; 11 | font-family: 'Pacifico',cursive; 12 | 13 | position: fixed; 14 | left: 2rem; 15 | top: 2rem; 16 | z-index:3; 17 | ` 18 | 19 | const LogoComponent = (props) => { 20 | return ( 21 | 22 | CB 23 | 24 | ) 25 | } 26 | 27 | export default LogoComponent 28 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/subComponents/ParticleComponent.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Particles from 'react-particles-js' 3 | import styled from 'styled-components' 4 | 5 | 6 | //particle config files 7 | import configDark from "../config/particlesjs-config.json"; 8 | import configLight from "../config/particlesjs-config-light.json"; 9 | 10 | 11 | 12 | 13 | const Box = styled.div` 14 | position: absolute; 15 | top:0; 16 | right:0; 17 | left:0; 18 | bottom:0; 19 | z-index:0; 20 | ` 21 | 22 | const ParticleComponent = (props) => { 23 | return ( 24 | 25 | 26 | 27 | ) 28 | } 29 | 30 | export default ParticleComponent 31 | -------------------------------------------------------------------------------- /Others/react-portfolio-final-main/src/subComponents/PowerButton.js: -------------------------------------------------------------------------------- 1 | // Home button 2 | 3 | import React from 'react' 4 | import { NavLink } from 'react-router-dom' 5 | import styled from 'styled-components' 6 | import { PowerBtn } from '../components/AllSvgs' 7 | 8 | 9 | const Power = styled.button` 10 | position: fixed; 11 | top: 2rem; 12 | left: 50%; 13 | transform: translate(-50%, 0); 14 | 15 | background-color: #FCF6F4; 16 | padding: 0.3rem; 17 | border-radius: 50%; 18 | border: 1px solid #000; 19 | width: 2.5rem; 20 | height: 2.5rem; 21 | 22 | display: flex; 23 | justify-content: center; 24 | align-items:center; 25 | z-index:3; 26 | 27 | cursor: pointer; 28 | 29 | &:hover{ 30 | background-color: rgba(0,255,0,0.4); 31 | box-shadow: 0 0 8px 6px rgba(0,255,0,0.2); 32 | } 33 | 34 | &>*:first-child{ 35 | text-decoration: none; 36 | color: inherit; 37 | } 38 | ` 39 | 40 | const PowerButton = () => { 41 | return ( 42 | 43 | 44 | 45 | 46 | 47 | ) 48 | } 49 | 50 | export default PowerButton 51 | -------------------------------------------------------------------------------- /Others/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/readme.txt -------------------------------------------------------------------------------- /Others/todo_application/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /Others/todo_application/Readme.md: -------------------------------------------------------------------------------- 1 | # A simple todo Application using reactjs and tailwindcss 2 | 3 | ## Features: 4 | 5 | - Create todo 6 | - Delete todo 7 | - Edit todo 8 | - Save into localstorage 9 | - Clean UI 10 | -------------------------------------------------------------------------------- /Others/todo_application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | TODO APPLICATION 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Others/todo_application/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "axios": "^1.1.2", 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0", 15 | "uuid": "^9.0.0" 16 | }, 17 | "devDependencies": { 18 | "@types/react": "^18.0.17", 19 | "@types/react-dom": "^18.0.6", 20 | "@vitejs/plugin-react": "^2.1.0", 21 | "autoprefixer": "^10.4.12", 22 | "postcss": "^8.4.17", 23 | "tailwindcss": "^3.1.8", 24 | "vite": "^3.1.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Others/todo_application/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /Others/todo_application/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Others/todo_application/src/App.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"); 2 | @tailwind base; 3 | @tailwind components; 4 | @tailwind utilities; 5 | 6 | * { 7 | font-family: "Inter", sans-serif; 8 | /* font-family: 'Poppins', sans-serif; */ 9 | } 10 | 11 | #root { 12 | width: 100%; 13 | min-height: 100vh; 14 | } 15 | 16 | .custom-scroll::-webkit-scrollbar { 17 | width: 5px; 18 | } 19 | 20 | /* Track */ 21 | .custom-scroll::-webkit-scrollbar-track { 22 | background: #fff; 23 | border-radius: 10px; 24 | } 25 | 26 | /* Handle */ 27 | .custom-scroll::-webkit-scrollbar-thumb { 28 | background: rgb(203, 203, 203); 29 | border-radius: 10px; 30 | } 31 | -------------------------------------------------------------------------------- /Others/todo_application/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import App from "./App"; 4 | 5 | ReactDOM.createRoot(document.getElementById("root")).render( 6 | 7 | 8 | 9 | ); 10 | -------------------------------------------------------------------------------- /Others/todo_application/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./src/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"], 3 | theme: { 4 | extend: {}, 5 | }, 6 | plugins: [], 7 | }; 8 | -------------------------------------------------------------------------------- /Others/todo_application/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()] 7 | }) 8 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weatherapp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.4", 7 | "@testing-library/react": "^13.1.1", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.1.0", 10 | "react-dom": "^18.1.0", 11 | "react-scripts": "5.0.1", 12 | "web-vitals": "^2.1.4" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/weather app in reactJS/public/favicon.ico -------------------------------------------------------------------------------- /Others/weather app in reactJS/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/weather app in reactJS/public/logo192.png -------------------------------------------------------------------------------- /Others/weather app in reactJS/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/Others/weather app in reactJS/public/logo512.png -------------------------------------------------------------------------------- /Others/weather app in reactJS/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Temp from './Components/Temp' 3 | 4 | function App() { 5 | return ( 6 | 7 | ) 8 | } 9 | 10 | export default App -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /Others/weather app in reactJS/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Developer_Code
2 | 3 | you can submit yout projects in frontend
4 | you can submit the dsa code
5 | 6 | 7 | Rules For Contributing 8 | * Star The Repository
9 | * Follow Me 10 | 11 | Feel free to submit issues and enhancement requests.
12 | Keep Contributing !! 13 | 14 | Please refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow. 15 | 16 | Fork the repo on GitHub 17 | Clone the project to your own machine 18 | Commit changes to your own branch 19 | Push your work back up to your fork 20 | Submit a Pull request so that we can review your changes 21 | After this please follow my id after checking then only i will merge 22 | 23 | 24 | 25 | ## Our Amazing Contributors 👨‍👨‍👦‍👦❤️ 26 | Thanks to all the contributors who worked for this project to stay alive! 😊😎 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /python/BubbleSort.py: -------------------------------------------------------------------------------- 1 | # Creating a bubble sort function 2 | def bubble_sort(list1): 3 | # Outer loop for traverse the entire list 4 | for i in range(0,len(list1)-1): 5 | for j in range(len(list1)-1): 6 | if(list1[j]>list1[j+1]): 7 | temp = list1[j] 8 | list1[j] = list1[j+1] 9 | list1[j+1] = temp 10 | return list1 11 | 12 | list1 = [5, 3, 8, 6, 7, 2] 13 | print("The unsorted list is: ", list1) 14 | # Calling the bubble sort function 15 | print("The sorted list is: ", bubble_sort(list1)) 16 | -------------------------------------------------------------------------------- /python/Connect_Four_Game.py: -------------------------------------------------------------------------------- 1 | """Connect Four 2 | 3 | Exercises 4 | 5 | 1. Change the colors. 6 | 2. Draw squares instead of circles for open spaces. 7 | 3. Add logic to detect a full row. 8 | 4. Create a random computer player. 9 | 5. How would you detect a winner? 10 | 11 | """ 12 | 13 | from turtle import * 14 | 15 | from freegames import line 16 | 17 | turns = {'red': 'yellow', 'yellow': 'red'} 18 | state = {'player': 'yellow', 'rows': [0] * 8} 19 | 20 | 21 | def grid(): 22 | "Draw Connect Four grid." 23 | bgcolor('light blue') 24 | 25 | for x in range(-150, 200, 50): 26 | line(x, -200, x, 200) 27 | 28 | for x in range(-175, 200, 50): 29 | for y in range(-175, 200, 50): 30 | up() 31 | goto(x, y) 32 | dot(40, 'white') 33 | 34 | update() 35 | 36 | 37 | def tap(x, y): 38 | "Draw red or yellow circle in tapped row." 39 | player = state['player'] 40 | rows = state['rows'] 41 | 42 | row = int((x + 200) // 50) 43 | count = rows[row] 44 | 45 | x = ((x + 200) // 50) * 50 - 200 + 25 46 | y = count * 50 - 200 + 25 47 | 48 | up() 49 | goto(x, y) 50 | dot(40, player) 51 | update() 52 | 53 | rows[row] = count + 1 54 | state['player'] = turns[player] 55 | 56 | 57 | setup(420, 420, 370, 0) 58 | hideturtle() 59 | tracer(False) 60 | grid() 61 | onscreenclick(tap) 62 | done() 63 | -------------------------------------------------------------------------------- /python/Count The Notebook.py: -------------------------------------------------------------------------------- 1 | for _ in range(int(input())): 2 | n = int(input()) 3 | no_of_pages = n * 1000 4 | no_of_nb = no_of_pages / 100 5 | 6 | print(int(no_of_nb)) 7 | -------------------------------------------------------------------------------- /python/Create Time Conversion.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import math 4 | import os 5 | import random 6 | import re 7 | import sys 8 | 9 | # 10 | # Complete the 'timeConversion' function below. 11 | # 12 | # The function is expected to return a STRING. 13 | # The function accepts STRING s as parameter. 14 | # 15 | 16 | def timeConversion(s): 17 | if s[-2:] == "AM" and s[:2] == "12": 18 | return "00" + s[2:-2] 19 | elif s[-2:] == "AM": 20 | return s[:-2] 21 | elif s[-2:] == "PM" and s[:2] == "12": 22 | return s[:-2] 23 | else: 24 | return str(int(s[:2]) + 12) + s[2:8] 25 | # Write your code here 26 | 27 | if __name__ == '__main__': 28 | fptr = open(os.environ['OUTPUT_PATH'], 'w') 29 | 30 | s = input() 31 | 32 | result = timeConversion(s) 33 | 34 | fptr.write(result + '\n') 35 | 36 | fptr.close() 37 | -------------------------------------------------------------------------------- /python/CreateLinkedList.py: -------------------------------------------------------------------------------- 1 | class Node: 2 | def __init__(self, dataval=None): 3 | self.dataval = dataval 4 | self.nextval = None 5 | 6 | class SLinkedList: 7 | def __init__(self): 8 | self.headval = None 9 | 10 | list1 = SLinkedList() 11 | list1.headval = Node("Mon") 12 | e2 = Node("Tue") 13 | e3 = Node("Wed") 14 | # Link first Node to second node 15 | list1.headval.nextval = e2 16 | 17 | # Link second Node to third node 18 | e2.nextval = e3 19 | -------------------------------------------------------------------------------- /python/Daanish and Problems.py: -------------------------------------------------------------------------------- 1 | for _ in range(int(input())): 2 | l = list(map(int, input().split())) 3 | k = int(input()) 4 | i = 9 5 | while k >= l[i]: 6 | k -= l[i] 7 | i -= 1 8 | print(i + 1) 9 | -------------------------------------------------------------------------------- /python/Day of the Programmer.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | import math 4 | import os 5 | import random 6 | import re 7 | import sys 8 | 9 | # 10 | # Complete the 'dayOfProgrammer' function below. 11 | # 12 | # The function is expected to return a STRING. 13 | # The function accepts INTEGER year as parameter. 14 | # 15 | 16 | 17 | def dayOfProgrammer(year): 18 | if year == 1918: 19 | return "26.09.1918" 20 | if year % 4 == 0 and (year < 1918 or year % 400 == 0 or year % 100 != 0): 21 | return "12.09.%s" % year 22 | return "13.09.%s" % year 23 | 24 | 25 | if __name__ == "__main__": 26 | fptr = open(os.environ["OUTPUT_PATH"], "w") 27 | 28 | year = int(input().strip()) 29 | 30 | result = dayOfProgrammer(year) 31 | 32 | fptr.write(result + "\n") 33 | 34 | fptr.close() 35 | -------------------------------------------------------------------------------- /python/PalindormeGenerator.py: -------------------------------------------------------------------------------- 1 | # Palindrome is a word, phrase, or sequence that reads the same backwards as forwards 2 | 3 | #getting the input string 4 | string=input('enter a stirng to get the corresponding palindrome: ') 5 | l=len(string) 6 | 7 | print('the generated palindrome is: ',end='') 8 | 9 | # if length of the input string is even 10 | if l%2==0: 11 | print(string,end='') 12 | for i in range(l): 13 | print(string[l-1],end='') 14 | l=l-1 15 | 16 | # if length of the input string is odd 17 | else: 18 | print(string,end='') 19 | for i in range(l-1): 20 | print(string[l-2],end='') 21 | l=l-1 -------------------------------------------------------------------------------- /python/Sqrt-x.py: -------------------------------------------------------------------------------- 1 | # Given a non-negative integer x, compute and return the square root of x. 2 | # Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. 3 | 4 | # Example 1: 5 | # Input: x = 4 6 | # Output: 2 7 | 8 | # Example 2: 9 | # Input: x = 8 10 | # Output: 2 11 | # Explanation: The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned. 12 | 13 | class Solution(object): 14 | def mySqrt(self, x): 15 | """ 16 | :type x: int 17 | :rtype: int 18 | """ 19 | 20 | if x==0 or x==1: 21 | return x 22 | 23 | start = 1 24 | end = x 25 | 26 | while start <= end: 27 | mid = (start + end)//2 28 | 29 | mid_sq = mid*mid 30 | 31 | if mid_sq == x: 32 | return mid 33 | 34 | if mid_sq < x: 35 | start = mid+1 36 | ans = mid 37 | else : 38 | end = mid-1 39 | 40 | return ans -------------------------------------------------------------------------------- /python/Typing_speed_game/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Typing Speed Game 3 | 4 | This game tests the typing speed of user, it can 5 | also be used to improve typing speed,or can be played for fun. 6 | 7 | ## Screenshots 8 | ![Getting Started](./type_speed_img.png) 9 | ## Technologies used 10 | Python -------------------------------------------------------------------------------- /python/Typing_speed_game/type_speed_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/python/Typing_speed_game/type_speed_img.png -------------------------------------------------------------------------------- /python/countdowntimer.py: -------------------------------------------------------------------------------- 1 | # import the time module 2 | import time 3 | 4 | # define the countdown func. 5 | def countdown(t): 6 | 7 | while t: 8 | mins, secs = divmod(t, 60) 9 | timer = '{:02d}:{:02d}'.format(mins, secs) 10 | print(timer, end="\r") 11 | time.sleep(1) 12 | t -= 1 13 | 14 | print('Fire in the hole!!') 15 | 16 | 17 | # input time in seconds 18 | t = input("Enter the time in seconds: ") 19 | 20 | # function call 21 | countdown(int(t)) 22 | -------------------------------------------------------------------------------- /python/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lonewolf0502/DeveloperCode/511b5c900e72abe2139bebb04b72fa6900971932/python/readme.txt -------------------------------------------------------------------------------- /python/reverse-string.py: -------------------------------------------------------------------------------- 1 | def reverse(s): 2 | str = "" 3 | for i in s: 4 | str = i + str 5 | return str 6 | 7 | s = "hactoberfest" 8 | 9 | print("The original string is : ", end="") 10 | print(s) 11 | 12 | print("The reversed string(using loops) is : ", end="") 13 | print(reverse(s)) 14 | -------------------------------------------------------------------------------- /python/sms_using_python.py: -------------------------------------------------------------------------------- 1 | import os 2 | from twilio.rest import Client 3 | 4 | 5 | # Find your Account SID and Auth Token at twilio.com/console 6 | # and set the environment variables. See http://twil.io/secure 7 | while True: 8 | 9 | account_sid ='your_account_sid' 10 | auth_token = 'your_auth_token' 11 | client = Client(account_sid, auth_token) 12 | 13 | 14 | 15 | text = "Sami loves you the most and always will , my wife my everything ❤️ " 16 | message = client.messages \ 17 | .create( 18 | body= f"{text}", 19 | from_='fromnumber', 20 | to='tonumber' 21 | ) 22 | 23 | print(message.sid) 24 | -------------------------------------------------------------------------------- /python/sortdate.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | lt = list() 4 | n = int(input("Enter the range: ")) 5 | for i in range(n): 6 | lt.append(input()) 7 | print("In ascending order: ") 8 | lt.sort(key=lambda date: datetime.strptime(date, "%d/%b/%Y")) 9 | print(lt) 10 | print("In descending order: ") 11 | lt.sort(key=lambda date: datetime.strptime(date, "%d/%b/%Y"), reverse=True) 12 | print(lt) 13 | -------------------------------------------------------------------------------- /python/turthex.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | t=turtle.Turtle() 3 | for i in range(6): 4 | t.forward(150) 5 | t.right(300) 6 | turtle.done() 7 | --------------------------------------------------------------------------------