𝐃𝐚𝐲 𝟔𝟕/𝟏𝟎𝟎 – Competitive Programming (Codeforces) Solved: B – Corner the Knight Interesting pattern observation problem. --If we look at the board diagonally, the knight moves form a pattern repeating every 3 positions. --The number of reachable points increases up to a midpoint and then decreases symmetrically. --Using this diagonal pattern, we can directly compute the number of feasible starting positions without simulation. #Codeforces #CompetitiveProgramming #100DaysOfCode #Math #Patterns #ProblemSolving #DSA #Cpp #Algorithms
Corner the Knight: Diagonal Pattern Solution
More Relevant Posts
-
It took a lot of time and 2 rough pages to solve 😭 . 𝐃𝐚𝐲 𝟕𝟐/𝟏𝟎𝟎 – Competitive Programming (CodeForces) Solved: 1731B – Kill Demodogs A math-heavy problem since n is huge, so brute force / DP on grid is not possible. -- Path is fixed in structure → from (1,1) → (1,n) → (n,n) -- Each cell contributes i * j, so we need to derive a closed-form sum -- Final formula comes out to: 2022 × n(n+1)(4n−1) / 6 Then just compute it carefully using modular arithmetic. #Codeforces #CompetitiveProgramming #100DaysOfCode #Math #NumberTheory #ProblemSolving #DSA #Cpp #Algorithms
To view or add a comment, sign in
-
-
𝐃𝐚𝐲 𝟗𝟐/𝟏𝟎𝟎 – Competitive Programming (CodeForces) Solved: 977C - Less or Equal, 1872D - Plus Minus Permutation --977C was simple greedy: sort the array and check the k-th position carefully to satisfy the condition. --1872D was more math + greedy: instead of building permutation, count multiples using LCM, assign largest values to x-multiples and smallest to y-multiples, then compute score. #Codeforces #CompetitiveProgramming #100DaysOfCode #Greedy #Math #NumberTheory #ProblemSolving #DSA #Cpp #Algorithms
To view or add a comment, sign in
-
-
At first glance, the Minimum Number of Coins problem seems like a perfect fit for a greedy approach. Pick the largest coin. Reduce the amount. Repeat. It works… until it doesn’t. As shown in the walkthrough, greedy can fail to give the optimal solution, which is where Dynamic Programming becomes essential. Understanding why an approach fails is what actually builds problem-solving depth. #DataStructures #Algorithms #DynamicProgramming #ProblemSolving #CodingInterview #SoftwareEngineering #LearnToCode #TechCareers #CompetitiveProgramming
To view or add a comment, sign in
-
Every great programmer starts with the basics. Diving deep into Singly Linked Lists — understanding how nodes connect, how memory is managed dynamically, and how operations like insertion and deletion actually work behind the scenes. It’s not just about code, it’s about building logic. awareness of hardware-level behavior like cache alignment and data locality. #Multithreading #Concurrency #Programming #SoftwareEngineering #BackendDevelopment #CPP #CppProgramming #ModernCPP #Multithreading #Concurrency #ParallelProgramming #STL #SystemProgramming #SoftwareEngineering #CodingLife #DSA #Coding #LinkedList #TechLearning #ProgrammerMindset
To view or add a comment, sign in
-
-
Day 43 ✅ of #GeekStreak2026 GeeksforGeeks POTD Today’s problem focused on Dynamic Programming (Subset / Difference based problem) 🧠 Worked with concepts like partitioning array into subsets with given difference, which is a variation of 0/1 Knapsack ⚡ Key Learning: Many DP problems are just variations of a core pattern — once you recognize it, solving becomes much faster #POTD #GeekStreak2026 #DSA #DynamicProgramming #Knapsack #CodingJourney #Consistency #PlacementPreparation
To view or add a comment, sign in
-
-
I’m excited to announce the release of Ferrite v2.1.0 — Standard Library & Builtins! 🚀 This update is a major milestone for the Ferrite compiler. We’ve successfully re-introduced our core standard library (math, strings, collections, io) as statically-embedded assets. This means the compiler is now fully self-contained and faster than ever! Key updates in v2.1: ✅ Embedded StdLib: Import math or strings directly with zero external dependencies. ✅ Refined Type System: Improved generic structural unification for safer and more flexible code. ✅ Collection Indexing: Native support for [] indexing on Maps and Lists. ✅ Simplified Distribution: A single, renamed ferrite.exe for streamlined system integration. The project continues to evolve as a statically-typed, AOT-compiled ML language built for performance and safety. Check out the latest release on GitHub: https://lnkd.in/gjVpDe9d #Ferrite #ProgrammingLanguages #Rust #CompilerDev #MachineLearning #OpenSource #SoftwareArchitecture
To view or add a comment, sign in
-
🚀 Day 69 of #100DaysOfCode 🔥 Problem: Majority Element II (LeetCode 229) Today’s challenge was all about finding elements that appear more than ⌊n/3⌋ times in an array. Sounds simple, but the twist is doing it efficiently! 💡 Key Insight: Instead of counting frequencies using extra space, we can use an optimized approach based on the Boyer-Moore Voting Algorithm. ✨ Approach Highlights: • There can be at most 2 majority elements (> n/3) • Maintain 2 candidates and their counts • First pass → find potential candidates • Second pass → verify their frequency ⚡ Why this works? Because any element appearing more than n/3 times will survive the elimination process. 📈 Complexity: • Time: O(n) • Space: O(1) 🎯 Takeaway: Smart algorithms > brute force. Understanding patterns like voting algorithms can save both time and space! #DSA #LeetCode #CodingJourney #ProblemSolving #100DaysOfCode #Algorithms #Programming
To view or add a comment, sign in
-
-
Recover the Tree ?? by providing water! Approach (Recover BST) Do inorder traversal (BST should be sorted) Track previous node If order breaks (prev > current), it’s a violation First violation: first = prev middle = current Second violation (if exists): last = current Time Complexity: O(n) → you traverse all nodes once using inorder Space Complexity: O(h) → recursion stack (h = height of tree) Worst case (skewed tree): O(n) Best case (balanced tree): O(log n) #LeetCode #DSA #DataStructures #Algorithms #Coding #Programming #binarysearchtree
To view or add a comment, sign in
-
-
If anyone is interested in developing their skills in Algorithms, here are two tips that helped me: - Focus on understanding common algorithm patterns (recursion, dynamic programming, graph traversal) rather than memorizing individual solutions. Recognizing patterns makes new problems easier to solve. - Practice consistently on platforms like LeetCode or HackerRank and review different solution approaches to understand how problems can be optimized.
To view or add a comment, sign in
-
𝐃𝐚𝐲 𝟖𝟎/𝟏𝟎𝟎 – Competitive Programming (CodeForces) • 2211A – Antimedian Deletion • 2211B – Mickey Mouse Constructive --A was about observing the pattern from sample testcases and applying it correctly. --B was a constructive problem, building the array using -1 and 1 based on conditions. #Codeforces #CompetitiveProgramming #100DaysOfCode #Constructive #Implementation #ProblemSolving #DSA #Cpp #Algorithms
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