Logo

CodeCraft

Competitive Programming for Beginners

🧩 Beginner Practice Problems

Curated problem sets across key topics. Mark problems as you solve them!

Pattern Printing

Arrays (AtCoder Beginner)

Strings (AtCoder Beginner)

Maths (AtCoder Beginner)

Searching & Sorting (AtCoder)

📘 Time and Space Complexity: A Beginner's Guide

Time and space complexity evaluates the efficiency of your code — how fast it runs and how much memory it uses. Mastering this is key to writing optimal solutions in competitive programming!

Time Complexity Visual: 0 Input Size (n) Steps O(1) O(n) O(n²)
Space Complexity Visual: O(1) O(n) O(n²)

⏳ What are Time Complexities?

  • O(1): Constant time. No matter the input size, the steps remain the same.
  • O(n): Linear time. Steps increase in proportion to input size.
  • O(n²): Quadratic time. Steps increase as the square of input size.
  • Other complexities: O(log n), O(n log n), O(2^n), etc.

💾 What are Space Complexities?

  • O(1): Uses a fixed amount of memory regardless of input size.
  • O(n): Uses memory proportional to input size.
🎬 Animation: What does O(n) mean?

As the input array grows, the steps required (loops) grow linearly.

📝 Mini Practice Problems

  1. If you have a loop over an array of size n, what is the time complexity?
  2. If you sort an array using Bubble Sort, what is its typical time complexity?
  3. Does storing an extra array of size n inside your function change space complexity? How?
Test yourself! Try answering these before you code.

🚀 Codeforces Adaptability Sheet

Track your Codeforces journey! Mark solved problems and return to your progress anytime with your unique username.

👤 User Login

🔥Spark Section (First 10)

No. Title Try It Solved

🧗‍♂️Climb Section (First 12)

No. Title Try It Solved

🏆Conquer Section (First 20)

No. Title Try It Solved
Progress saved automatically per username. No password/registration needed.