Skip to content

Práticas e desafios de programação resolvidos por iniciativa própria, com foco em lógica, algoritmos e estruturas de dados. Principalmente soluções do LeetCode.

Notifications You must be signed in to change notification settings

righigor/coding-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Coding Practice

LeetCode Codewars GitHub repo size Last Commit Auto Merge Daily Top Language

📚 Table of Contents


📌 About

This repository is a collection of programming challenges I solve to practice problem-solving, algorithms, and data structures.

Most challenges come from platforms like LeetCode and Codewars.

Each solution is implemented with clarity and often contains comments explaining the logic behind it.


🎯 Goal

  • ✅ Improve logical thinking
  • ✅ Master data structures and algorithms
  • ✅ Prepare for coding interviews
  • ✅ Build a reference library of patterns and approaches

📁 Folder Structure

coding-practice/
├── .github/
│   └── workflows/
│       └── auto-merge.yml
├── leetcode/
│   └── daily/
│       └── 2025-04-21-name-of-question.js
├── codewars/
│   ├── 8kyu/
│   └── 6kyu/
├── create-daily-leet.js
└── README.md
  • leetcode/daily/: Contains daily LeetCode challenges.
    Files are named using the format YYYY-MM-DD-question-title.js for better organization and readability.

  • codewars/: Contains Codewars challenges, organized by difficulty level (8kyu, 6kyu, etc.).

  • README.md: This file, providing an overview of the repository and instructions for use.

  • create-daily-leet.js: Script to create new exercise files automatically.


🧠 Practice Stats

LeetCode Codewars
LeetCode Stats Codewars Stats

💻 Create Exercise File Script

Overview

This repository includes a script that automates the creation and organization of daily LeetCode challenge files. When executed, it:

  • Creates a new file with the current date and formatted exercise name in the leetcode/daily/ directory.
  • Automatically updates the leetcode/daily/readme.md file with the challenge title, a placeholder description, the approach, and a link to the solution file.
  • Updates with the total number of solved challenges and a direct badge counter.

Currently supported languages: JavaScript, Python, C, and Java.

How to Use

  1. Open your terminal and navigate to the root of the repository.

  2. Run the following command to execute the script and create a new exercise file:

    node create-daily-leet.js <exercise-name> <extension>

    Example:

    node create-daily-leet.js count-good-triplets js

    This command will create:

    • a file called count-good-triplets.js inside the appropriate directory (leetcode/daily/);
    • An entry in leetcode/daily/readme.md with the problem title and metadata;
    • A badge in the leetcode/daily/readme.md file that counts the total number of solved problems.
  3. After running the command, the file will be created, but it might not show up immediately in the VSCode file explorer.

📌 Notes

  • Ensure Node.js is installed on your system to run the script;
  • If you rename or delete files manually, remember to update the readme.md files accordingly or re-run the script to regenerate them.

Troubleshooting (If the file doesn't appear in VSCode)

If the newly created file does not appear instantly in the VSCode file explorer:

  1. Manually Refresh the Explorer:

    • In VSCode, click the Refresh Explorer button on the file explorer pane to update the view and show the newly created file.

    Or, you can reload the entire window by pressing:

    • Ctrl + R (Windows/Linux) or Cmd + R (macOS).
  2. Check File Existence in Terminal:

    • If the file still doesn't appear, check the directory from the terminal to confirm it exists:
      ls leetcode/daily

If the file exists but doesn't show up in VSCode, refreshing or restarting VSCode should solve the problem.


🔁 Automation

This repository uses a GitHub Actions workflow to automatically merge the daily-leetcode branch into the main branch on every push to daily-leetcode.

This helps keep the main branch always up to date with the latest solved problems without requiring manual pull requests.

🛠 Workflow Details

  • Workflow file: auto-merge-daily.yml
  • Trigger: Push events on the daily-leetcode branch
  • Action:
    • Checks out the repository
    • Switches to the default branch (main)
    • Merges changes from daily-leetcode
    • Pushes the updated main branch

This automation is especially useful for keeping the project organized and up to date while working on daily coding challenges.

About

Práticas e desafios de programação resolvidos por iniciativa própria, com foco em lógica, algoritmos e estruturas de dados. Principalmente soluções do LeetCode.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •