├── .gitignore ├── LICENSE ├── README.md ├── SUMMARY.md └── make.sh /.gitignore: -------------------------------------------------------------------------------- 1 | #to exclude unnecessary files and folders from version control. 2 | *.log 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2023 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 75 Days DSA challenge 2 | 3 | ## Introduction 4 | 5 | 75 days challenge is an in-club initiative by CodeChef ABESEC Chapter to 6 | increase the consistency and build a community within the club. 7 | 8 | To get started with the 75 Days DSA Challenge using this template, 9 | follow these steps: 10 | 11 | 1. Create your Repository: Click the "Use Template" button at the top right of 12 | this repository to create your own copy. 13 | 14 | 2. Clone the Repository: Clone your forked repository to your local machine 15 | using the following command: 16 | 17 | `git clone https://github.com//Daily75.git` 18 | 19 | 3. Create a New Branch: Create a new branch for your challenge journey. 20 | 21 | `git checkout -b day1` 22 | 23 | 4. Form directory structure of the Repository: Use the `make.sh` script to form directory structure 24 | 25 | | Action | Command | Example | 26 | | ----------------------------------- | ---------------------------- | --------------------- | 27 | | To create a day folder | `./make.sh form ` | `./make.sh form 10` | 28 | | To clean a day folder | `./make.sh clean all>` | `./make.sh clean 5` | 29 | | To create all directories (1 to 75) | `./make.sh form ` | `./make.sh form all` | 30 | | To clean all directories (1 to 75) | `./make.sh clean ` | `./make.sh clean all` | 31 | 32 | 33 | 34 | 35 | 36 |
Note: This Bash script, make.sh, is intended for Unix-based systems like Linux and macOS. To use it on Windows, you'll need to install a Bash environment, such as Windows Subsystem for Linux (WSL) or Git Bash. Once installed, follow the README for instructions.
37 | 38 | 5. Solving Problems: Use this template to write your code for solving DSA 39 | problems. You can use any programming language of your choice. Organize your code in a 40 | structured manner within the appropriate folders. 41 | 42 | 6. Problem Descriptions: Add problem descriptions, links, or any additional 43 | information about the problem you are solving in `SUMMARY.md` or as comments 44 | in your code. 45 | 46 | 7. Commit and Push: After solving a problem, commit your changes and push them to your forked repository. 47 | 48 | ```bash 49 | git add . 50 | git commit -m "Solved problem for Day 1" 51 | git push origin day1 52 | ``` 53 | 54 | 8. Once you are done with you task, merge the branch onto you main branch of you repository 55 | 56 | 9. Repeat: Repeat the process for each day of the challenge, creating a new branch for each day and solving DSA problems. 57 | 58 | ## Structure of the Repository 59 | 60 | This template repository is structured to help you organize your DSA challenge 61 | journey efficiently. The main directories and files you'll find in this 62 | repository include: 63 | 64 | 1. day_01/, day_02/, ..., day_75/: Each day has its own folder where you can 65 | place the code for the problems you solve on that specific day. 66 | 67 | 2. `SUMMARY.md`: You can update this main readme file with your progress, 68 | notes, and any additional information you'd like to share with others about your solution. 69 | 70 | 3. `.gitignore`: A standard .gitignore file to exclude unnecessary files 71 | and folders from version control. 72 | 73 | ## Rules and Guidelines 74 | 75 | To make the most of this challenge and your journey: 76 | 77 | 1. Solve at least one DSA problem every day. 78 | 2. Document your solutions and problem descriptions. 79 | 3. Commit and push your code regularly to track your progress. 80 | 4. Feel free to collaborate and learn from others who are taking the challenge. 81 | 5. Stay consistent, and remember that the key to success is daily practice. 82 | 83 | ## Conclusion 84 | 85 | The 75 Days DSA Challenge Template provides you with a structured and 86 | organized way to enhance your DSA skills. By following this template, 87 | you can track your progress, document your solutions, and collaborate 88 | with others who are on the same journey. Happy coding and best of luck with 89 | your DSA challenge! 90 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Day XX 2 | 3 | ## Question 4 | 5 | What was the question? Breakdown the question into smaller parts and describe properly 6 | 7 | ## Solution 8 | 9 | How did you approached the solution? Is is the best solution possible? 10 | 11 | ## TIL 12 | 13 | [Today I Learn] What did you learn? What new things you explored/discovered 14 | 15 | ## Citations 16 | 17 | What article, codebase, book, YouTube video etc did you referred? 18 | -------------------------------------------------------------------------------- /make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script Name: make.sh 4 | # Description: A script to create and clean day's folders for 75 days DSA challenge . 5 | # Author: Tanveer Raza 6 | # Copyright (c) 2023 CodeChef Chapter ABES EC Licensed under the MIT License 7 | 8 | # Function to create a day folder 9 | create_day() { 10 | local day_number="$1" 11 | local folder_name="day_$(printf "%02d" "$day_number")" 12 | 13 | if [ -d "$folder_name" ]; then 14 | echo "Folder for day $day_number already exists, skipping." 15 | else 16 | mkdir -p "$folder_name" 17 | cp -i "SUMMARY.md" "$folder_name/SUMMARY.md" 18 | echo "Created folder for day $day_number" 19 | fi 20 | } 21 | 22 | # Function to form day folders 23 | form_day_folders() { 24 | local target_day="$1" 25 | 26 | if [ "$target_day" == "all" ]; then 27 | for i in {1..75}; do 28 | create_day "$i" 29 | done 30 | echo "Form operation completed." 31 | elif [[ "$target_day" =~ ^[0-9]+$ ]]; then 32 | create_day "$target_day" 33 | else 34 | echo "Invalid day number: $target_day" 35 | fi 36 | } 37 | 38 | # Function to clean day folders with an optional --force flag 39 | clean_day_folders() { 40 | local target_day="$1" 41 | local force_flag="$2" 42 | 43 | if [ "$target_day" == "all" ]; then 44 | for i in {1..75}; do 45 | if [ "$force_flag" == "--force" ]; then 46 | remove_day "$i" 47 | else 48 | remove_day_with_conditions "$i" 49 | fi 50 | done 51 | echo "Clean operation completed." 52 | elif [[ "$target_day" =~ ^[0-9+$ ]]; then 53 | if [ "$force_flag" == "--force" ]; then 54 | remove_day "$target_day" 55 | else 56 | remove_day_with_conditions "$target_day" 57 | fi 58 | else 59 | echo "Invalid day number: $target_day" 60 | fi 61 | } 62 | 63 | # Function to remove a day folder with conditions 64 | remove_day_with_conditions() { 65 | local day_number="$1" 66 | local folder_name="day_$(printf "%02d" "$day_number")" 67 | 68 | if [ -d "$folder_name" ]; then 69 | # Check if SUMMARY.md exists in the root folder 70 | if [ -f "SUMMARY.md" ]; then 71 | # Check if SUMMARY.md in the day folder is the same as the one in the root folder 72 | if cmp -s "SUMMARY.md" "$folder_name/SUMMARY.md"; then 73 | # Check if there are files other than SUMMARY.md in the day folder 74 | if [ $(find "$folder_name" -maxdepth 1 -type f | wc -l) -eq 1 ]; then 75 | rm -rf "$folder_name" 76 | echo "Removed folder for day $day_number" 77 | else 78 | echo "Folder for day $day_number contains files other than SUMMARY.md, skipping removal." 79 | fi 80 | else 81 | echo "SUMMARY.md in folder $folder_name is different from the one in the root folder, skipping removal." 82 | fi 83 | else 84 | echo "SUMMARY.md is missing in the root folder, skipping removal." 85 | fi 86 | else 87 | echo "Folder for day $day_number does not exist, skipping." 88 | fi 89 | } 90 | 91 | # Function to remove a day folder 92 | remove_day() { 93 | local day_number="$1" 94 | local folder_name="day_$(printf "%02d" "$day_number")" 95 | 96 | if [ -d "$folder_name" ]; then 97 | rm -rf "$folder_name" 98 | echo "Removed folder for day $day_number" 99 | else 100 | echo "Folder for day $day_number does not exist, skipping." 101 | fi 102 | } 103 | # Main script 104 | if [ "$1" == "form" ] || [ "$1" == "create" ]; then 105 | form_day_folders "$2" 106 | elif [ "$1" == "clean" ] || [ "$1" == "remove" ]; then 107 | clean_day_folders "$2" "$3" 108 | else 109 | echo "Usage: ./make.sh {{form|create}|{clean|remove}} {|all} [--force]" 110 | fi 111 | --------------------------------------------------------------------------------