🚀 Day 4 | 30-Day Coding Challenge – Educative.io Today’s problem: Find the single non-duplicate element in a sorted array. At first, I explored the simple O(n) approaches — 🔹 Using a Set to track duplicates (O(n) time + O(n) space) 🔹 Summing unique vs. total values and finding the difference (O(n) time) 🔹 Linear scan comparing curr and next (O(n) time, O(1) space) All worked… but the goal was O(log n) time and O(1) space. Then it clicked 💡 — since the array is sorted, every pair of equal numbers appears side-by-side. Before the unique element, pairs start at even indices; after it, they start at odd indices. Using this pattern with binary search, I halved the search space each step: if nums[mid] == nums[mid+1] → move right else move left. Every challenge so far is sharpening how I reason about patterns and constraints rather than just syntax. #Day4 #30DaysOfCode #Educative #JavaScript #BinarySearch #ProblemSolving #DSA #LearningInPublic
"30-Day Coding Challenge: Finding a Non-Duplicate in a Sorted Array"
More Relevant Posts
-
Day 33 — Loops & Conditions Practice | 2.0 Job-Ready AI-Powered Cohor Sheryians Coding School🚀 Today was all about hands-on coding with JavaScript loops & conditionals. Practiced real logic-building exercises like: ✅ Print numbers 1 to 10 ✅ Print even numbers using loops + condition ✅ Print numbers 10 to 1 (reverse loop) ✅ Print "YES" 5 times using a loop ✅ Ask a number → check positive or negative ✅ Ask user's age → check voting eligibility ✅ Multiplication table of 5 using loop ✅ Understand & handle edge cases with if-else The more I practice these logic patterns, the more comfortable I get with problem-solving in JavaScript 💪 #JavaScript #WebDevelopment #Frontend #CodingPractice #SheryiansCodingSchool #100DaysOfCode #DeveloperJourney
To view or add a comment, sign in
-
-
Day 39 of Cohort 2.0 🚀 Today’s session was all about diving into Objects in JavaScript and applying concepts through practical problem-solving. 💻 Here’s what I learned today: 🔹 Objects in JavaScript → Store data in key-value pairs for structured and organized coding 🔹 Accessing & Modifying Object Properties → Learn how to read, update, and delete data dynamically 🔹 Functions + Arrays + Objects Practice → Strengthened logic by solving real-world coding problems combining all three concepts ✨ Key takeaway: Understanding how to work with objects and integrating them with arrays and functions makes JavaScript code more powerful, modular, and efficient. Sheryians Coding School #sheryianscodingschool #cohort2 #learningjourney #dailyupdates #JavaScript #WebDevelopment #Frontend
To view or add a comment, sign in
-
-
Day 35 Today’s session was all about problem-solving in JavaScript. We practiced different logic-based questions using for loops, if-else conditions, and a few real-world scenarios to strengthen our understanding of core concepts. These kinds of sessions really help in improving logical thinking and building a stronger coding foundation Guided by Harsh Vandana Sharma at Sheryians Coding School #JavaScript #ProblemSolving #WebDevelopment #LearningJourney #Coding #SheryiansCodingSchool
To view or add a comment, sign in
-
-
Day 31 of #100DaysOfCode – Building Logic with Conditions and Loops in JavaScript Today’s session focused on strengthening core programming logic using conditional statements and loops. Key Learnings: Understood how if, else if, and else conditions control program flow. Explored looping structures to execute repetitive tasks efficiently. Learned how combining these concepts helps in building real-world logic and problem-solving patterns. Takeaway: Mastering loops and conditions is the foundation for writing efficient, dynamic, and logical code in JavaScript. Grateful to Harsh Vandana Sharma from Sheryians Coding School and Sheryians Coding School Community for guiding us through today’s session with clear explanations and practical logic-building examples. #100DaysOfCode #JavaScript #WebDevelopment #CodingJourney #Frontend #ProgrammingLogic
To view or add a comment, sign in
-
-
🚀 Day 35 - Deep Dive into Loops | JavaScript Today’s session took our JavaScript journey to the next level! We explored advanced looping concepts through Level-2 problem-solving exercises, combining for, while, and user interactions with prompt(). 💡 Key Learnings: 🔹 Strengthened logical thinking through real-world problems. 🔹 Broke down complex tasks into smaller, manageable steps. 🔹 Wrote dynamic code that interacts with user input. 🔹 Used loops and conditionals to generate specific outputs and patterns. 🧠 Harsh Bhaiya guided us to approach each challenge strategically first understanding the problem, visualizing loop flow, and then crafting efficient solutions. His advice reminded us that true learning happens when we struggle, reason, and solve independently. Each question solved today added to my confidence and made me appreciate how loops truly power logic in programming. Feeling proud, prepared, and excited to take on even tougher challenges ahead! 💪 📚 Student at: Sheryians Coding School #JavaScript #WebDevelopment #CodingJourney #LearningEveryday #SheryiansCodingSchool #ProblemSolving
To view or add a comment, sign in
-
-
Day 7 of Learning JavaScript from Sheryians Coding School Today, I have learned about loops, recursion, and functions. do...while: Executes the code inside the "do" block at least once and then checks the condition in "while". The loop continues based on the condition. Recursion: A function calling itself is known as recursion. It continues until a specific condition is met. Loop Control: continue: Skips the current iteration of the loop and moves to the next one. Functions: A function does not execute immediately; it runs only when called. A function can be called multiple times. Arguments: Used to access values that are passed when the function is called. Hoisting in Functions: Functions can be accessed or called even before they are declared. #JavaScript #WebDevelopment #CodingJourney #LearningWithSheryians #ProgrammingConcepts
To view or add a comment, sign in
-
I used to think functions were just a simple way to wrap code. I was wrong—they're the key to writing truly clean, reusable code. Following up on my last post about my practice landing page (two weeks ago!), I spent the past few weeks diving deep into JavaScript functions. My biggest moment? Function Scope! It’s basically a protective bubble. Any variables defined inside the function stay locked inside. This focus on isolation is huge for building reliable code and is a core part of the DRY (Don't Repeat Yourself) principle. Learning functions feels like unlocking the real power of JavaScript. Excited to dive into objects next! What was the first JavaScript concept that truly made you go, "Aha!"? Sheryians Coding School #JavaScript #WebDevelopment #CodingJourney #Functions #FrontendDev
To view or add a comment, sign in
-
-
⚙️ Day 37 — Functions in JavaScript (All Topics Covered) Today at Sheryians Coding School Cohort 2.0, we completed one of the most important concepts in JavaScript — Functions. 💻 Here’s what I learned and practiced: ✅ Function declaration and expression ✅ Parameters and return values ✅ Function scope and variable accessibility ✅ Arrow functions and their syntax ✅ Real use cases of functions in programs Understanding how functions work felt like learning how to organize logic smartly. They make code cleaner, reusable, and easier to debug — a true backbone of JavaScript programming. Takeaway: Functions aren’t just blocks of code — they’re the heart of every program. Mastering them makes everything ahead much easier! 🚀 #Day37 #ShreyiansCodingSchool #Cohort2 #JavaScript #Functions #CodingJourney #FrontendDevelopment #LearnByDoing #Consistency
To view or add a comment, sign in
-
-
Day 38 — More Functions & Arrays | 2.0 Job-Ready AI-Powered Cohort Sheryians Coding School🚀 Today’s session covered deeper JavaScript fundamentals: ✅ More Function Concepts Anonymous, higher-order, callback, first-class functions Pure vs impure functions ✅ Understanding Scope Global, local, block scope ✅ Closures What closures are and why they’re useful ✅ Arrays Creating arrays, accessing elements Methods: push, pop, shift, unshift, filter, indexOf, spread operator Looping arrays with for and forEach ✅ Objects Creating, accessing, modifying objects Nested objects & object methods Bit by bit, JavaScript is getting clearer and more powerful 🔥 #JavaScript #WebDevelopment #Frontend #SheryiansCodingSchool #Arrays #Functions
To view or add a comment, sign in
-
-
Day 35 of #100DaysOfCode – Functions, Recursion & Do-While Loop in JavaScript Today’s learning focused on some of the most important programming fundamentals in JavaScript: Key Learnings: Do-While Loop → Understanding how it executes the block at least once before checking the condition Functions in JavaScript → Structure, reusability, and clean code Arguments vs Parameters → How data is passed and handled Rest Parameters → Efficient way to work with variable number of inputs Recursion → Calling functions within themselves to solve repeating subproblems Hoisting → Variable Hoisting — behavior differences between var, let, and const Function Hoisting — how JavaScript moves function declarations to the top during execution Takeaway: Functions and recursion unlock powerful logic possibilities, and understanding hoisting helps avoid unexpected bugs. These concepts form the backbone of writing optimized and predictable JavaScript code. A big thanks to Harsh Vandana Sharma from Sheryians Coding School and Sheryians Coding School Community for making function mechanics and hoisting concepts easy to understand with practical examples. #100DaysOfCode #JavaScript #Functions #Recursion #WebDevelopment #CodingJourney #Frontend
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