Add beautiful website interface and Z-Algorithm implementation - #356
Add beautiful website interface and Z-Algorithm implementation#356Adithyakp86 wants to merge 3 commits into
Conversation
Thanks for creating a PR for your Issue!
|
|
Sorry @Adithyakp86 |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a modern website interface for the Daily-DSA repository and implements a complete Z-Algorithm problem solution. The changes create a beautiful, responsive web interface with search and filtering capabilities while adding comprehensive Z-Algorithm implementations in Python, Java, and C++.
- Added complete website interface with modern UI/UX design
- Implemented Z-Algorithm pattern matching with full documentation
- Fixed import error in Best Time to Buy and Sell Stock problem
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| index.html | Main website interface with search, filtering, and modal system |
| style.css | Comprehensive CSS with responsive design and modern styling |
| script.js | JavaScript functionality for search, filtering, and navigation |
| Strings/Z-Algorithm/Python_code.py | Complete Python implementation with test cases |
| Strings/Z-Algorithm/Java_code.java | Java implementation with multiple variants |
| Strings/Z-Algorithm/C++_code.cpp | C++ implementation with performance optimizations |
| Strings/Z-Algorithm/Markdown.md | Comprehensive documentation and algorithm explanation |
| Arrays/Best_Time_to_Buy_and_Sell_Stock/Python_code.py | Fixed missing import statement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // Map display names to actual folder names | ||
| const folderMap = { | ||
| 'Arrays': 'Arrays', | ||
| 'Binary Search': 'Binary Search', | ||
| 'Binary Trees': 'Binary Trees', | ||
| 'Dynamic Programming': 'Dynamic Programming', | ||
| 'Graphs': 'Graphs', | ||
| 'Strings': 'Strings', | ||
| 'Linked Lists': 'Linked Lists', | ||
| 'Stack and Queue': 'Stack and Queue', | ||
| 'Sorting': 'Sorting', | ||
| 'Hashing': 'Hashing', | ||
| 'Two Pointers': 'Two Pointers', | ||
| 'Sliding Window': 'Sliding Window', | ||
| 'Greedy': 'Greedy', | ||
| 'Recursion and Backtracking': 'Recursion and Backtracking', | ||
| 'Matrix': 'Matrix', | ||
| 'Math': 'Math', | ||
| 'Bit Manipulation': 'Bit Manipulation', | ||
| 'Heap': 'Heap', | ||
| 'Tries': 'Tries' | ||
| }; | ||
|
|
||
| const folderName = folderMap[topicName] || topicName.replace(/\s+/g, '_'); |
There was a problem hiding this comment.
[nitpick] The folderMap object contains redundant mappings where the key and value are identical. This adds unnecessary code complexity. Consider removing entries where the display name matches the folder name exactly, or use a Set for topics that don't need mapping and only map the exceptions.
| // Map display names to actual folder names | |
| const folderMap = { | |
| 'Arrays': 'Arrays', | |
| 'Binary Search': 'Binary Search', | |
| 'Binary Trees': 'Binary Trees', | |
| 'Dynamic Programming': 'Dynamic Programming', | |
| 'Graphs': 'Graphs', | |
| 'Strings': 'Strings', | |
| 'Linked Lists': 'Linked Lists', | |
| 'Stack and Queue': 'Stack and Queue', | |
| 'Sorting': 'Sorting', | |
| 'Hashing': 'Hashing', | |
| 'Two Pointers': 'Two Pointers', | |
| 'Sliding Window': 'Sliding Window', | |
| 'Greedy': 'Greedy', | |
| 'Recursion and Backtracking': 'Recursion and Backtracking', | |
| 'Matrix': 'Matrix', | |
| 'Math': 'Math', | |
| 'Bit Manipulation': 'Bit Manipulation', | |
| 'Heap': 'Heap', | |
| 'Tries': 'Tries' | |
| }; | |
| const folderName = folderMap[topicName] || topicName.replace(/\s+/g, '_'); | |
| // Use topicName directly as folder name, replacing spaces with underscores | |
| const folderName = topicName.replace(/\s+/g, '_'); |
| n = len(s) | ||
| z = [0] * n | ||
|
|
||
| # Z[0] is always 0 as it's the entire string |
There was a problem hiding this comment.
The comment on line 19 is incorrect. Z[0] is set to n (the length of the entire string), not 0. The comment should read '# Z[0] is always n as it represents the entire string length' or similar to accurately reflect the implementation.
| # Z[0] is always 0 as it's the entire string | |
| # Z[0] is always n as it represents the entire string length |
| int n = s.length(); | ||
| int[] z = new int[n]; | ||
|
|
||
| // Z[0] is always 0 as it's the entire string |
There was a problem hiding this comment.
The comment on line 18 is incorrect. Z[0] is set to n (the length of the entire string), not 0. The comment should read '// Z[0] is always n as it represents the entire string length' to match the actual implementation.
| // Z[0] is always 0 as it's the entire string | |
| // Z[0] is always n as it represents the entire string length |
| int n = s.length(); | ||
| vector<int> z(n, 0); | ||
|
|
||
| // Z[0] is always 0 as it's the entire string |
There was a problem hiding this comment.
The comment on line 23 is incorrect. Z[0] is set to n (the length of the entire string), not 0. The comment should read '// Z[0] is always n as it represents the entire string length' to accurately describe the implementation.
| // Z[0] is always 0 as it's the entire string | |
| // Z[0] is always n as it represents the entire string length |
|
Please create an issue first! |
|
Or just tell me about your intuition for this! |
|
i changed some files add z algorithm and simple website for this |
|
You can't add everything in just a one PR @Adithyakp86 |
plus your website creation with script.js also does make sense here, You can create an issue for that too @Adithyakp86 ! Question: |


Add beautiful website interface and Z-Algorithm implementation
===>
fixes
[New Problem] Sort a Linked List #354
[New Problem] Z-Algorithm for Pattern Matching #355
Daily-DSA/
├── index.html (NEW)
├── style.css (NEW)
├── script.js (NEW)
└── Strings/
└── Z-Algorithm/ (NEW FOLDER)
├── Python_code.py (NEW)
├── Java_code.java (NEW)
├── C++_code.cpp (NEW)
└── Markdown.md (NEW)
Issue number if any:-
Fixes #<issue_number>
✅ Contribution Checklist (make sure all are checked)
.cpp,.java,.py, etc.)📝 Type of Addition (check any one)
📊 Last check (make sure all are checked
🏢 Your Organization?