Skip to content

Add beautiful website interface and Z-Algorithm implementation - #356

Open
Adithyakp86 wants to merge 3 commits into
shivamm-verma:mainfrom
Adithyakp86:main
Open

Add beautiful website interface and Z-Algorithm implementation#356
Adithyakp86 wants to merge 3 commits into
shivamm-verma:mainfrom
Adithyakp86:main

Conversation

@Adithyakp86

@Adithyakp86 Adithyakp86 commented Sep 8, 2025

Copy link
Copy Markdown

Add beautiful website interface and Z-Algorithm implementation

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)

  • Code file added (.cpp, .java, .py, etc.)
  • Markdown file added with:
    • Problem statement
    • Example input/output
    • Generic logic
    • Time & space complexity

📝 Type of Addition (check any one)

  • DSA problem addition
  • Fix mistakes in existing codebase
  • Add better solutions
  • Make docs better

📊 Last check (make sure all are checked

  • Have you checked that this problem isn't already in the codebase?🔍
  • Did you cross-check that your code/explanation is right?

🏢 Your Organization?

  • GsSOC'25

@github-actions

github-actions Bot commented Sep 8, 2025

Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@shivamm-verma

Copy link
Copy Markdown
Owner

Sorry @Adithyakp86
But you can't raise a PR, until you create an issue, and it get assigned to you!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread script.js
Comment on lines +408 to +431
// 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, '_');

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
// 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, '_');

Copilot uses AI. Check for mistakes.
n = len(s)
z = [0] * n

# Z[0] is always 0 as it's the entire string

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# Z[0] is always 0 as it's the entire string
# Z[0] is always n as it represents the entire string length

Copilot uses AI. Check for mistakes.
int n = s.length();
int[] z = new int[n];

// Z[0] is always 0 as it's the entire string

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// Z[0] is always 0 as it's the entire string
// Z[0] is always n as it represents the entire string length

Copilot uses AI. Check for mistakes.
int n = s.length();
vector<int> z(n, 0);

// Z[0] is always 0 as it's the entire string

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// Z[0] is always 0 as it's the entire string
// Z[0] is always n as it represents the entire string length

Copilot uses AI. Check for mistakes.
@shivamm-verma

Copy link
Copy Markdown
Owner

Please create an issue first!

@shivamm-verma

Copy link
Copy Markdown
Owner

Or just tell me about your intuition for this!

@shivamm-verma shivamm-verma added the invalid This doesn't seem right label Sep 8, 2025
@Adithyakp86

Copy link
Copy Markdown
Author

i changed some files add z algorithm and simple website for this

@shivamm-verma

Copy link
Copy Markdown
Owner

You can't add everything in just a one PR @Adithyakp86
For this you would have to create 3 multiple PRs(and so 3 Issues)

@shivamm-verma

Copy link
Copy Markdown
Owner
image

As from this, I would suggest you to just raise an Issue for "Z Algo" in strings as

@shivamm-verma

Copy link
Copy Markdown
Owner
image

plus your website creation with script.js also does make sense here, You can create an issue for that too @Adithyakp86 !

Question: script.js for this will be automatically updated with the new/latest codebase, right? or is it pre fixed–no updates/sync.

@shivamm-verma shivamm-verma added enhancement New feature or request questioned Further information is requested labels Sep 9, 2025
@shivamm-verma shivamm-verma added Pause⌛ Paused working for this Issue. and removed questioned Further information is requested labels Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request invalid This doesn't seem right Pause⌛ Paused working for this Issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants