diff --git a/Akash Kumar/1.GroupAnagrams/Screenshot .png b/Akash Kumar/1.GroupAnagrams/Screenshot .png new file mode 100644 index 0000000..4757fc8 Binary files /dev/null and b/Akash Kumar/1.GroupAnagrams/Screenshot .png differ diff --git a/Akash Kumar/1.GroupAnagrams/soln.c++ b/Akash Kumar/1.GroupAnagrams/soln.c++ new file mode 100644 index 0000000..8fc04bd --- /dev/null +++ b/Akash Kumar/1.GroupAnagrams/soln.c++ @@ -0,0 +1,43 @@ +//LeetCode Environment +//Time Complexity=O(Nβˆ—M) +//Space Complexity=O(Nβˆ—M) + +class Solution { +public: + + string generate(string word) + { + int arr[26]={0}; + for(char ch:word) + { + arr[ch-'a']++; + } + string new_word=""; + for(int i=0;i<26;i++) + { + int freq=arr[i]; + if(freq>0) + { + new_word+=string(freq,i+'a'); + } + } + return new_word; + } + vector> groupAnagrams(vector& strs) + { + unordered_map>mp; + vector>result; + for(int i=0;i& nums, int k) + { + int ans=0; + int l=0; + for (int r=0;r - ``` -4. Move into the cloned folder: - ```bash - cd Assignment-2 - ``` - ---- - -### πŸ“– Step 3: Solve 2 New Questions - -1. Open the `Assignment-2_Questions.xlsx` file. -2. Pick any 2 questions you **did not submit in Assignment-1**. -3. Solve them using your preferred language: Java, Kotlin, Python, C++, etc. - ---- - -### πŸ“ Step 4: Add Your Files - -For each question: - -- Create a folder like this: - ``` - submissions/// - ``` - _Example_: `submissions/AyushSingh/PalindromeCheck/` - -Inside each folder, include: -- βœ… Your solution code (e.g., `solution.java`) -- πŸ–Ό Screenshot of passing test cases (`screenshot.png`) -- πŸ“ Optional: Small `README.md` file explaining your logic - -**Folder structure example**: -``` -submissions/ -└── YourName/ - β”œβ”€β”€ Question1/ - β”‚ β”œβ”€β”€ solution.py - β”‚ └── screenshot.png - └── Question2/ - β”œβ”€β”€ solution.java - └── screenshot.png -``` - ---- - -### πŸ› οΈ Step 5: Add, Commit & Push Your Work - -1. Add your work: - ```bash - git add . - ``` - -2. Commit with a clear message: - ```bash - git commit -m "Day 2 assignment by " - ``` - -3. Push your code: - ```bash - git push origin main - ``` - ---- - -### πŸ” Step 6: Create a Pull Request - -1. Go to your forked repository on GitHub. -2. Click **β€œCompare & pull request”**. -3. Fill in: - - Your name - - The two new questions you solved - - Any additional comments -4. Submit the pull request to this repository. - ---- - -## ❗ Important Guidelines - -- Do **not repeat** questions you submitted in Assignment-1. -- Make sure your **file structure is correct** and includes: - - Code file - - Screenshot showing test success -- You can use **LeetCode, HackerRank, CodeChef**, or your own IDE. - ---- - -## 🧠 Tools You Can Use - -You’re free to solve questions using: -- Java, Kotlin, Python, C++, C, JavaScript -- LeetCode, CodeChef, HackerRank, Replit, or VS Code - ---- - -## πŸ’¬ Need Help? - -If you face any issues or confusion: -πŸ“© Reach out to our speaker on LinkedIn: -πŸ”— [Zaid Sayyed – LinkedIn](https://www.linkedin.com/in/zaid-sayyed/) - ---- - -Thank you for your dedication and participation! -Let’s keep building and learning together πŸ’»πŸ”₯ -β€” *Team CodeResite*