Day 19 of #100DaysOfCode Solved “Base 7” problem today — a simple yet insightful exercise on number systems. 💡 Approach: Convert the integer into base 7 by repeatedly dividing by 7 and storing remainders. Handle negative numbers separately and reverse the result at the end. ⚡ Key Learning: Even easy problems strengthen fundamentals like loops, math logic, and edge case handling. Consistency > Complexity. #LeetCode #DSA #CodingJourney #Java #ProblemSolving #100DaysOfCode
Solving Base 7 Problem in 100 Days of Code
More Relevant Posts
-
#CodeEveryday — My DSA Journey | Day 3 🧩 Problem Solved: Combination Sum III (LeetCode #216) 💭 What I Learned: Used backtracking to find all possible combinations of k numbers (1–9) that sum up to a target n. At each step: ✔️ Decided whether to include the current number ✔️ Reduced both the remaining sum (n) and count (k) ✔️ Ensured each number is used only once by moving to the previous index Applied constraints effectively to prune recursion when: Remaining sum becomes negative Required count becomes invalid This improved my understanding of handling multiple constraints (sum + size) simultaneously in recursion. ⏱ Time Complexity: O(C(9,k) 🧠 Space Complexity: O(k) (recursion depth) ⚡ Key Takeaways: ✔️ Backtracking with multiple constraints requires careful pruning ✔️ Fixed input size can significantly reduce complexity ✔️ Choosing + skipping pattern helps explore all valid combinations 💻 Language Used: Java ☕ 📘 Concepts: Backtracking · Recursion · Combinations · Constraint Handling #CodeEveryday #DSA #LeetCode #Java #Backtracking #ProblemSolving #Algorithms #CodingJourney #Consistency 🚀
To view or add a comment, sign in
-
-
Day 22/100 — LeetCode Today’s problem: Happy Number 😊 At first, it looked like a simple math problem… but it turned out to be about patterns and repetition. 🔍 What I learned: Break a number into digits using % 10 and / 10 Square each digit and keep adding Repeat the process until: You reach 1 → Happy Number ✅ Or it starts repeating → Not Happy ❌ 🧠 Key Insight: This problem is actually about cycle detection — if a number repeats, it will never reach 1. ⚡ Simple Example: 19 → 82 → 68 → 100 → 1 ✅ 💡 Takeaway: Sometimes problems that look like math are really about loops and patterns. Small steps every day → Big improvement 🚀 #Day22 #100DaysOfCode #LeetCode #Java #DSA #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 44/100 Today’s problem: Reverse Vowels of a String. 🔹 Problem Summary: Given a string, reverse only the vowels while keeping other characters in the same position. 🔹 Approach I Used: I applied the Two Pointer Technique: - One pointer from the start, one from the end - Move both until vowels are found - Swap them and continue 🔹 Key Learning: ✔ Two pointers can simplify string problems a lot ✔ Always break the problem into smaller steps ✔ Practice improves pattern recognition. 🔹 Example: Input: "IceCreAm" Output: "AceCreIm" 🔹 Time Complexity: O(n) 🔹 Space Complexity: O(n) Consistency is the key 🔑 — showing up every day! #Day44 #CodingJourney #DSA #Java #Learning #100DaysOfCode
To view or add a comment, sign in
-
-
💻 Day 80 – DSA Practice (Binary Trees) Today’s challenge: 👉 Find all root-to-leaf paths where the sum equals a given target. 🔹 Approach: Use Depth-First Search (DFS) Track the current path and remaining sum When reaching a leaf node, check if the sum matches 💡 Key Concepts: Recursion + Backtracking Tree traversal (DFS) Efficient sum handling ⚡ Insight: Reducing the target sum at each step makes the solution cleaner and avoids recalculating sums. #DSA #BinaryTree #Java #CodingJourney #100DaysOfCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 70 — LeetCode Practice ✅ Problem Solved: Minimum Operations to Make Array Sum Divisible by K 💡 What I learned today: • Understood how modulus (%) helps in solving optimization problems • Learned that instead of performing operations repeatedly, we can directly use math logic • Realized that the answer depends on sum % k • Improved thinking towards efficient (O(n)) solutions 📊 Approach: • Calculated total sum of the array • Found remainder using sum % k • That remainder itself gives the minimum operations required 🎯 Key Insight: Sometimes, problems look complex but can be solved using simple mathematical observations instead of brute force 🔥 Consistency is the key — showing up every day! #Day70 #LeetCode #DSA #CodingJourney #ProblemSolving #Consistency #Java
To view or add a comment, sign in
-
-
#100DaysOfCode – Day 2 Today I worked on a DSA problem based on arrays: Check if an array is sorted and rotated 🔍 Approach: Instead of finding the exact rotation point, I focused on identifying a pattern: In a sorted and rotated array, the order should break at most once. So, I checked how many times an element is greater than the next element while traversing the array in a circular manner. ✔️ If the count of such breaks is 0 or 1 → valid ❌ If it’s more than 1 → not a sorted rotated array 🧠 Key Takeaway: This problem taught me how pattern observation can simplify logic and avoid unnecessary complexity. Sometimes the best solution is not the most obvious one! 📈 Staying consistent and improving step by step 💪 #100DaysOfCode #DSA #DataStructures #Algorithms #Java #CodingJourney #ProblemSolving #LeetCode #Consistency
To view or add a comment, sign in
-
-
🔥 Day 63 of #100DaysOfCode Solved – Missing Number 🔍 What I did: Calculated the expected sum of numbers from 0 to n and subtracted the actual sum of the array to find the missing number efficiently. 💡 Key Learning: Learned how to use mathematical formula (n × (n+1) / 2) Practiced optimizing from brute force to O(n) solution Improved understanding of number patterns in arrays 🎯 Takeaway: Using mathematical insights can simplify problems and eliminate the need for extra loops or space. #Day62 #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode #DSA
To view or add a comment, sign in
-
-
🚀 Day 11/100 — #100DaysOfLeetCode Consistency continues — one problem closer to better problem-solving skills 💻🔥 ✅ Problem Solved: 🔹 LeetCode 1423 — Maximum Points You Can Obtain from Cards 💡 Concepts Used: Sliding Window Technique Complementary Subarray Thinking 🧠 Key Learning: Instead of directly choosing k cards from both ends, I learned to think differently — find the minimum sum subarray of size n - k and subtract it from the total sum. This transformation converts a complex decision problem into a clean sliding window optimization. ⚡ Takeaway: Sometimes optimization comes from changing perspective, not increasing complexity. Continuing the journey 🚀 #100DaysOfLeetCode #LeetCode #DSA #SlidingWindow #Algorithms #Java #ProblemSolving #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day 56 of #100DaysOfLeetCode Solved: Longest Substring Without Repeating Characters Today’s problem really tested my understanding of the sliding window technique. 🔹 Key Learning: Instead of restarting the window when a duplicate appears, I used a HashMap to track the last index of characters and moved the left pointer smartly using Math.max(). This helped maintain an optimal window without unnecessary rework. 🔹 Approach: Used two pointers (left & right) Stored last seen index of each character Adjusted window dynamically to avoid duplicates 🔹 Complexity: Time: O(n) Space: O(n) This problem made me realize how important it is to truly understand pointer movement rather than just memorizing patterns. Slowly building consistency and clarity, one problem at a time. #LeetCode #DSA #Java #CodingJourney #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 47of my #100DaysOfCode Journey Today, I solved the LeetCode problem: Mirror Distance of an Integer Problem Insight: Given a number, the task is to find the absolute difference between the original number and its reversed form. Approach: • Stored the original number in a temporary variable • Reversed the number using digit extraction (modulo and division) • Calculated the absolute difference between the original and reversed number Time Complexity: O(d), where d = number of digits Space Complexity: O(1) Key Learnings: • Digit manipulation using modulo and division is a powerful technique • Always store the original value before modifying the input • Reversing numbers is a fundamental pattern in many DSA problems Takeaway: Breaking the problem into simple steps makes even tricky-looking logic easy to solve. #DSA #Java #LeetCode #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development