Skip to content

prasanth3316/Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

My Journey: From Hello World to Competitive Programming

I am Prasanth,

  • Solved more than 1400 Problems on LC ( I liked LC features like Daily Streak and LC tshirt )
  • I have rating of 1890+ on LC ( Knight )
  • I am part of University of Cincinnati ICPC Club (2024-25)

Do you know how Second Method for Binary Search ?

Do you know Matrix Exponentiation Application in Graphs ?

Do you know Various Multiplication Algorithms ?

Look these in ' Books I Personally Recommend ' section


This is roughly the order I followed and what I'd recommend to someone starting out today.

A small disclaimer before I start: I am not really a competitive programmer. I prepared all of this mainly for interviews during my bachelor's. But the foundation is the same — so if your goal is cracking interviews and not turning red on Codeforces, this path still works for you.


How I Started

I started coding in C, then learnt Java, then Python, and finally C++. Honestly, I hate Java — the syntax is too long, and it never felt good to me for working with data structures. I ended up using Python the most.

In the beginning, I didn't know anything about competitive programming. I was just learning a language to write a program and see the output on screen — that was the whole goal. Later, I started attacking HackerRank to solve questions. To be honest, it was more fun than I expected: just watching test cases fail and pass, solving problems to get stars on HackerRank — that loop kept me hooked.

After that I moved on to platforms like LeetCode and CodeChef. But I genuinely feel HackerRank is the best platform to start with while you are still learning the basics of a language. At this stage you don't need OOP yet, and you can start with any programming language. Many good programmers use C++; I personally don't know C++ that well.

My journey started in my bachelor's. These days a lot of people start as early as school, which is great — earlier the better.


After the Basics: Building Your Own Data Structures

Once you are confident with the basics of a language and the basic structures it gives you, I feel this is the time to start understanding more advanced data structures — and more importantly, how to build them using the basic ones.

For example: building a graph in Python using a dict.

So you first need to know how to use standard data structures like lists and dictionaries well. Then you use them to build more advanced ones (graphs, trees, heaps, and so on). This is the bridge step that most beginners skip.


Then Comes the Algorithmic Mindset

Once you're comfortable building and using data structures, you can start learning the core problem-solving methods:

  • Complete Search
  • Greedy
  • Divide and Conquer
  • Dynamic Programming

You will also encounter these inside advanced data structure problems, but understanding each technique on its own is important.

Another important thing — and people often skip this — is analysis of algorithms: time and space complexity. These two decide whether your solution passes the test cases or not. They are what separates a good solution from a bad one.


What I Studied (and What I Recommend)

Videos

Striver's playlist is the best resource for this stage. Watch it at 2x speed with notes to cover it faster. I learnt a lot from his videos. To be honest, I have forgotten some of it now too — that's normal, you'll re-learn things many times.

Books

I mostly prefer these three. The order I'd recommend reading them in today is different from the order I personally read them:

  1. Algorithms — Jeff Erickson. I studied this recently and it is very interesting and very well structured. I strongly advise reading this one. It would be my starting book if I were beginning today.
  2. Guide to Competitive Programming — Antti Laaksonen. I like some specific sections in this book a lot: the second method for Binary Search, section 5.3, and the chapters on Binary Indexed Tree and Segment Tree. I keep coming back to those.
  3. Competitive Programming 3 — Halim & Halim. I haven't read the whole book, but I strongly recommend reading at least the initial sections. They give you a real sense of what this CP world is — many thanks to the authors for that introduction. Use the rest as a reference once you are deeper into the journey.

I read the first two books some years ago. Erickson's book is the one I'd start with today.

I have physical copies of all of these. Online versions are easy to find as well.


How I Practice

I prefer doing questions on LeetCode while learning topics. The approach is simple: practice topics as per the book — learn a topic, then immediately do questions on LeetCode for that topic. LC has many standard questions, and a lot of them are also asked in interviews, so the time you put in pays back twice.

Alongside LeetCode, GeeksforGeeks is also great. It has a huge collection of standard questions with clear written explanations. I use it a lot when I want to read an explanation rather than watch a video.

And if you are stuck on a question even after reading the editorial or solution — just watch a YouTube video on it. There is no shame in that. Sometimes a visual explanation makes a concept click in 5 minutes that you have been struggling with for hours on paper.

Please take your time and don't rush through the topics. There is no prize for finishing the list fast.


Moving to Contests

Once you have learnt the topics, you can start participating in contests. My recommended order:

  1. LeetCode contests first — friendliest format, problems closer to what you've already practiced.
  2. CodeChef next — slightly more competitive-programming-flavoured.
  3. Codeforces last — this is where the real CP community lives, but the pace and difficulty can be brutal early on.

In between these, if you are still in college, it's good to try competitions like TCS CodeVita or Infosys HackWithInfy. These are hard — I have never solved more than 4 problems in them — but the experience is genuinely valuable, and they look good on a resume too.


Staying Consistent

Honestly, the hardest part of all of this is just showing up regularly. A few small habits go a very long way:

  • LeetCode Daily Question — one problem a day, no excuses. Even on days when you don't solve it, just reading the problem keeps your brain warm.
  • GeeksforGeeks Problem of the Day — same idea, different platform. Often more interview-flavoured.
  • Regular contests — pick a contest you can attend most weeks (LeetCode Weekly, AtCoder Beginner Contest, Codeforces Div. 3/4) and treat it like a fixed appointment. Showing up matters more than performing well.

Community is the other half of consistency:

  • If you are an undergrad, look for your university's ICPC club or coding club. Practicing with peers, doing team contests, and just having someone to discuss problems with will accelerate everything.
  • If you are still in high school, USACO is what you want. It is free, structured (Bronze → Silver → Gold → Platinum), respected globally, and gives you a clear ladder to climb.

You don't need to do all of this at once. Pick one daily habit and one weekly contest. That alone puts you ahead of most people.


A Few Honest Things

  • You will forget things. That's fine. Re-learning is part of the process.
  • You don't need C++ to start. Use the language you're comfortable with first, switch later if you need the speed.
  • The ultimate goal is simple: recognize the pattern of a question and apply the right data structure or technique. That is it. Stars, ratings, and contest ranks are fun motivators, but pattern recognition is the actual skill — and it takes time. Be patient with yourself.
  • I won't pretend I always get the right answer. I don't, even now. But solving more questions helps a little more each time. The improvement is slow and not always visible, but it is real.

Some Hacks

  • If you want to solve more questions on LC - DO HASHMAP, DFS and BFS related questions - You will cover 500+ Questions on these topics
  • LC is easy , If you want to learn more do CODEFORCES ( IF you want to do CP more )

A Personal Note — My Own Journey Through CP


Platforms I Used

Platform My Experience
HackerRank My entry point into structured problem solving — used extensively during Bachelor's 1st year to build foundational confidence in DSA and language basics.
LeetCode My primary platform through Bachelor's 4th year — invaluable for interview preparation, weekly contests, and reinforcing problem-solving patterns under time pressure.
CodeChef Used consistently across my undergraduate years — the Long Challenge format was particularly useful for developing deeper problem intuition without the stress of short windows.
Kattis My introduction to Kattis was through the University of Cincinnati ICPC Club — a memorable first encounter with team-style, ICPC-format problem solving.
USACO Guide Discovered and worked through this resource after completing my Bachelor's degree — its structured Bronze-to-Platinum roadmap is among the most disciplined learning paths available for free.
CSES Problem Set Used actively during my Master's studies — the problem set is remarkably well-curated and covers every core CP topic with precision. Highly recommended for graduate-level self-study.

Books I Personally Recommend

Book My Take
Competitive Programming 4 – Halim (CP4) Read during my Bachelor's years. The early chapters are particularly significant — they lay the philosophical and structural groundwork for understanding what competitive programming truly is. The content may carry some age, but its foundational value remains undiminished. My strong recommendation: do not skip the first chapters.
Guide to Competitive Programming – Laaksonen (CSES) This is my personal favourite. Concise, modern, and exceptionally well-organized. I like all sections as this Book is well organized to revise easily. I like segment tree and Fenwick tree sections so much
Algorithms – Jeff Erickson (Free) My favourite algorithms book — freely available, academically rigorous, and written with rare clarity. Strong Connected Components and others graph related sections are outstanding. This book deserves a place on every serious programmer's reading list.

-- You know Method 2 of Binary search ? - Want to learn - Study Guide to Competive Programming


Courses

I explored several courses on Coursera during my studies — particularly in algorithms and data structures. While I do not recall every title, the Coursera catalogue (notably offerings from Princeton and UC San Diego) provided strong structured exposure to algorithmic theory alongside practical contest preparation.


Contests I Participated In

Contest Notes
TCS CodeVita Participated in all four years of my Bachelor's degree — a consistent annual commitment that sharpened my ability to perform under real contest conditions.
Google Kick Start Participated once — a well-designed contest with problems that reward algorithmic thinking at every skill level.
HackWithInfy – Infosys Participated once — a valuable experience in applied problem solving under a corporate contest format.
LeetCode Weekly / Biweekly Contests Participated regularly — the contest environment on LeetCode is one of the most accessible ways to experience rated competition.
CodeChef Contests Participated regularly across undergraduate years — the variety of contest formats on CodeChef made it a reliable training ground.

Releases

No releases published

Packages

 
 
 

Contributors