Skip to content

Conversation

@zwbproducts
Copy link

Date: 2026-01-28
Repo: https://github.com/zwbproducts/HackerRank-Solutions

Summary

This PR fixes repository-hygiene issues that made the repo awkward to use in shells and automation:

  • Removes spaces from solution filenames (shell/CI-safe paths).
  • Standardizes solution filenames to snake_case.
  • Organizes solutions into language-based folders.
  • Adds missing project documentation.

Problems found (and fixed)

1) Critical: filenames with spaces

Problem: Many source files used spaces in filenames (e.g., algo rotation.c).

Impact: Breaks common tooling and CI scripts unless everything is carefully quoted.

Fix: Renamed to snake_case with no spaces and moved under solutions/.

2) Missing docs

Problem: No README / contributing guidance / style guidance / changelog / code of conduct.

Fix: Added:

  • README.md
  • CONTRIBUTING.md
  • CHANGELOG.md
  • CODE_STYLE.md
  • CODE_OF_CONDUCT.md
  • solutions/README.md

3) Flat repo structure

Problem: All solution files were in the repository root.

Fix: Introduced:

  • solutions/c/ (C)
  • solutions/cpp/ (C++)

4) Extension/code mismatch

Problem: Several .c files were actually C++ (e.g., #include <iostream>).

Fix: Moved those to solutions/cpp/ and renamed them to .cpp.

File moves / renames

C:

  • ceasar cipher.csolutions/c/caesar_cipher.c

C++:

  • algo rotation.csolutions/cpp/algo_rotation.cpp
  • Angryprofessor.csolutions/cpp/angry_professor.cpp
  • angry children.cppsolutions/cpp/angry_children.cpp
  • bus station.csolutions/cpp/bus_station.cpp
  • cavity map.csolutions/cpp/cavity_map.cpp
  • chocolate feast.csolutions/cpp/chocolate_feast.cpp
  • cut the sticks.csolutions/cpp/cut_the_sticks.cpp
  • find digits.csolutions/cpp/find_digits.cpp
  • find median.cppsolutions/cpp/find_median.cpp
  • flowers.cppsolutions/cpp/flowers.cpp
  • grid search.csolutions/cpp/grid_search.cpp
  • k candy store.csolutions/cpp/k_candy_store.cpp
  • manasa and stones.csolutions/cpp/manasa_and_stones.cpp
  • minimum draws.cppsolutions/cpp/minimum_draws.cpp
  • running time.cppsolutions/cpp/running_time.cpp
  • service lane.csolutions/cpp/service_lane.cpp
  • sherlock and beast.csolutions/cpp/sherlock_and_beast.cpp
  • songs of pi.cppsolutions/cpp/songs_of_pi.cpp
  • utopian tree.cppsolutions/cpp/utopian_tree.cpp

How to build

See README.md for simple compile/run examples.

Notes

This PR intentionally focuses on repository usability and maintainability. It does not attempt to rewrite algorithms or change solution behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant