๐Ÿš€ 3 Days into My DSA Journey: Brute-Forcing My Way into Better Thinking

Piyush KumarPiyush Kumar
4 min read

Published on May 24, 2025 | 4 min read
By: Piyush Kumar | Portfolio | GitHub


TL;DR: Starting my Data Structures and Algorithms journey with brute force solutions. Here's what I learned solving Two Sum, Longest Substring, and Palindrome problems in 3 days - plus all my code and key insights for fellow beginners.


Why I'm Documenting My DSA Journey Publicly

If you're a beginner programmer or computer science student wondering whether to start DSA, this post is for you. I'm sharing my raw, unfiltered experience because:

  • ๐Ÿ“ˆ Accountability: Public learning keeps me consistent

  • ๐Ÿค Community: Help others avoid my mistakes

  • ๐Ÿ’ก Growth: Teaching reinforces my own learning

The Reality Check: You don't need to be perfect to start. You just need to start.


๐Ÿง  Day 1: Time Complexity Reality Check - Two Sum Problem

The Problem That Humbled Me

Problem: Two Sum (LeetCode Easy)
My Approach: Brute Force (Nested Loops)
Time Complexity: O(nยฒ)
Space Complexity: O(1)

# My first attempt - brute force
def two_sum_brute_force(nums, target):
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] + nums[j] == target:
                return [i, j]

๐Ÿ’ก Key Learnings:

  • Big O isn't just theory - it's the language of scalable code

  • Nested loops = performance nightmare for large datasets

  • Sometimes brute force helps you understand the problem better

What's Next:

  • Implement HashMap solution (O(n) time complexity)

  • Compare performance with larger datasets


๐Ÿ’ก Day 2: String Manipulation Challenge - Longest Substring

When "Medium" Feels Like "Hard"

Problem: Longest Substring Without Repeating Characters
Difficulty: Medium (felt like Expert ๐Ÿ˜…)
My Approach: Brute Force with Set
Time Complexity: O(nยณ)

# Character tracking gets messy fast!
def lengthOfLongestSubstring(str1):
    max_length = 0
    n = len(str1)

    for i in range(n):
        sub1 = []
        for j in range(i, n):
            if str1[j] not in sub1:
                sub1.append(str1[j])
            else:
                break
        max_length = max(max_length, len(sub1))  

    return max_length

๐ŸŽฏ Breakthrough Moments:

  • Character tracking is trickier than it looks

  • Sliding window technique exists for a reason (implementing next!)

  • Brute force taught me the core challenge before optimization


๐Ÿ” Day 3: Pattern Recognition - Palindrome Validation

Finally, A Win That Felt Good!

Problem: Valid Palindrome
Difficulty: Easy
Approach: Two-Pointer Technique
Time Complexity: O(n)

class Solution:
    def lengthOfLongestSubstring(self, s: str) -> int:
        max_length = 0
        n = len(s)

        for i in range(n):
            sub1 = []
            for j in range(i, n):
                if s[j] not in sub1:
                    sub1.append(s[j])
                else:
                    break 
            max_length = max(max_length, len(sub1))  

        return max_length

๐Ÿš€ Why This Felt Different:

  • Two-pointer technique clicked immediately

  • Clean string manipulation made the solution elegant

  • First time I felt "this is how algorithms should work"


๐Ÿ“Š My 3-Day Progress Analytics

MetricResult
Problems Solved3
Time Spent~6 hours
Lines of Code150+
"Aha!" Moments4
Debugging SessionsToo many to count ๐Ÿ˜‚

๐ŸŽฏ Key Insights for Fellow Beginners

โœ… What's Working:

  1. Start with brute force - understand the problem first

  2. Document everything - your future self will thank you

  3. Time complexity awareness - changes how you think about code

  4. Consistency > perfection - small daily progress compounds

๐Ÿšซ What I'm Avoiding:

  • Comparing my Day 3 to someone's Day 300

  • Skipping the "boring" fundamentals

  • Optimizing before understanding


๐Ÿ”ฎ What's Coming Next Week

Immediate Goals:

  • Optimize existing solutions using better algorithms

  • Master sliding window technique for substring problems

  • Implement HashMap solutions for O(n) time complexity

  • Document daily learnings on Twitter

Learning Resources I'm Using:

  • LeetCode for problems

  • YouTube for visual explanations

  • GitHub for code organization

  • This blog for accountability


๐Ÿค Join My Learning Journey

Are you learning DSA too? Let's grow together!

Connect with me:

How You Can Help:

  • โญ Star my repo if you find it helpful

  • ๐Ÿ’ฌ Share your own DSA journey in the comments

  • ๐Ÿ”„ Retweet to help other beginners find this

  • ๐Ÿ“จ DM me your questions - I'll try to help!


If you're just starting:

  1. Don't skip Big O notation - it's fundamental

  2. Code along, don't just read - muscle memory matters

  3. Explain your solution out loud - teaches you to think clearly

  4. Join online communities - learning together is faster


Remember: Every expert was once a beginner. Every pro was once an amateur. Every icon was once an unknown.

The best time to start was yesterday. The second best time is now.


Found this helpful? Follow my journey and let's master DSA together! Drop a comment below with your own learning experiences.

Tags: #DSA #DataStructures #Algorithms #Programming #Python #LeetCode #TechCareer #CodingJourney #BeginnerFriendly #TechBlog


About the Author:
I am a passionate developer documenting My journey from beginner to proficient in Data Structures and Algorithms. Follow my daily progress and learn together with the community.

0
Subscribe to my newsletter

Read articles from Piyush Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Piyush Kumar
Piyush Kumar

Hey there! Iโ€™m Piyush Kumar, a curious mind on a mission to master Data Structures & Algorithms โ€” one problem at a time. Iโ€™m not just solving questions; Iโ€™m building habits, debugging my thinking, and documenting the highs and lows of my coding grind. Whether itโ€™s arrays at midnight, graph theory before coffee, or that satisfying โ€œACโ€ moment after 17 failed attempts โ€” Iโ€™m sharing it all openly. ๐Ÿ“š Currently on a 90-day DSA challenge, I post daily blogs and code logs that unpack: Real-world problem-solving strategies Patterns and techniques I learn (and unlearn) Honest reflections on growth, failure, and consistency Along the way, Iโ€™m also exploring how to apply AI to meaningful problems โ€” because I believe in learning out loud and building in public. Letโ€™s connect if youโ€™re into: Open learning journeys ๐Ÿš€ Problem-solving and pattern recognition ๐Ÿง  Building cool things with code โš™๏ธ โšก Follow along and letโ€™s decode DSA โ€” together!