Day 135 of #GFG160DayChallenge
Problem: Job Sequencing Problem
Approach:
We sort jobs by profit in descending order. For each job, we try to place it in the latest possible free slot before its deadline.
#GFG160#geekstreak2025@geeksforgeeks
Day 133 of #GFG160DayChallenge
Problem: Minimum Platforms Required
Approach: We sort both the arrival and departure arrays and use two pointers to simulate the train schedule:
#GFG160#geekstreak2025@geeksforgeeks@sandeep_jain
Day 132 of #GFG160DayChallenge
Problem: Word Break
Approach: We use recursive backtracking with a dictionary hash map to check if the input string can be segmented into space-separated words present in the dictionary.
#GFG160#geekstreak2025@geeksforgeeks@sandeep_jain
GeeksforGeeks is more than just a platform — it’s a reliable 24/7 mentor for every tech enthusiast. 💻
Stuck on a doubt? Need guidance? GFG is always there with quick support and quality content you can trust.
Choose @GFG — because your career deserves the best.
@geeksforgeeks
Day 131 of #GFG160DayChallenge
Problem: Boolean Parenthesization
Appro: We use recursive DP with memoization to count the number of ways to parenthesize the expression so that it evaluates to True.
T C: O(n³)
S C: O(n²)
#GFG160#geekstreak2025@geeksforgeeks@sandeep_jain
Day 130 of #GFG160DayChallenge
Problem: Matrix Chain Multiplication
Approach:
We use bottom-up DP to find the minimum cost of multiplying matrices defined by dimensions in arr[].
Time Complexity: O(n³)
#GFG160#geekstreak2025
Day 129 of #GFG160DayChallenge
Problem: Decode Ways
Approach:
We use space-optimized dynamic programming:
prev1 stores ways to decode up to previous character.
prev2 stores ways up to two characters back.
Time Complexity: O(n)
Space Complexity: O(1)
#GFG160#geekstreak2025
Day 128 of #GFG160DayChallenge
Problem: Stickler Thief 2 (Circular Houses Variant)
Approach: In this variation, the first and last houses are adjacent (circular street), so we can't rob both.
Time Complexity: O(n)
Space Complexity: O(1)
#GFG160#geekstreak2025@sandeep_jain
Day 127 of #GFG160DayChallenge
Problem: Stickler Thief
Approach: This is a variation of the House Robber problem.
Time Complexity: O(n)
Space Complexity: O(n)
#GFG160#geekstreak2025@geeksforgeeks
Day 126 of #GFG160DayChallenge
Problem:Stock Buy and Sell – Max 2 Transactions Allowed
Approach: We use dynamic programming where dp[i][j] stores the maximum profit using at most i transactions until day j
T-C: O(n)
S-C: O(n)
#GFG160#geekstreak2025@geeksforgeeks
Day 125 of #GFG160DayChallenge
Problem: Best Time to Buy and Sell Stock - K Transactions
Approach:We maintain two arrays:
buy[j]: max profit after buying the j-th stock
sell[j]: max profit after selling the j-th stock
T C: O(n * k)
#GFG160#geekstreak2025@geeksforgeeks
Day 124 of #GFG160DayChallenge
Problem: Partition Equal Subset Sum
Approach: We first calculate the total sum of the array. If it's odd, we can't divide it equally.
TC: O(n * sum)
SC: O(n * sum)
#GFG160#geekstreak2025@geeksforgeeks
Day 123 of #GFG160DayChallenge
Problem: Subset Sum Problem
Approach: We use 1D DP where dp[j] tells if sum j is possible using elements seen so far.
T-Complexity: O(n * sum)
S-Complexity: O(sum)
#GFG160#geekstreak2025@geeksforgeeks
Day 122 of #GFG160DayChallenge
Problem: Minimum Jumps
Approach: We use a greedy strategy:
jump keeps track of steps we can still take.
T-Complexity: O(n)
S-Complexity: O(1)
#GFG160#geekstreak2025@geeksforgeeks
Day 121 of #GFG160DayChallenge
Problem: Minimum Coins
Approach:We use a 1D DP array dp[] where dp[i] holds the minimum number of coins needed to get sum i. Initialize all values as Integer.
T-Complexity: O(n * sum)
S-Complexity: O(sum)
#GFG160#geekstreak2025@geeksforgeeks
Day 120 of #GFG160DayChallenge
Problem: Coin Change
Approach: This is a variation of the unbounded knapsack problem. We use a 1D DP array where dp[i] stores the number of ways to make sum i.
Complexity: O(n * sum)
Space : O(sum)
#GFG160#geekstreak2025@geeksforgeeks
Day 119 of #GFG160DayChallenge
Problem: 0/1 Knapsack
Approach: A 1D DP array is used to optimize space. Iterate through items, and for each weight from W to wt[i].
Time: O(n * W)
Space: O(W)
#GFG160#geekstreak2025@geeksforgeeks
Day 118 of #GFG160DayChallenge
Problem: Min Cost Climbing Stairs
Approach: The idea is to use a bottom-up approach with constant space.
Time: O(n)
Space: O(1)
#GFG160#geekstreak2025@geeksforgeeks
16 Followers 37 FollowingI am a passionate #software_engineer with a postgraduate degree (MCA) and expertise in MERN stack and Laravel PHP development. Skilled in creating dynamic web
2K Followers 2K FollowingA JavaScript Junkie 💻| Documenting my journey in tech 📝 | Daily tweets about Web development ⌨️🤝| A Passionate Chess Player♟️.
18K Followers 16K FollowingFreeBSD advocate who is heavily into Ansible, BGP (AS20621), DevOps, Kubernetes, Proxmox, XCP-ng, Python, Rust & RISC-V and builds own decentralized solutions.
24 Followers 91 Following💻 https://t.co/OZbnTP3a5m CSE | DSA in Java + Web Dev
🚀 #GFG160 Challenger | Building & Learning Daily
📚 Sharing My Journey | Open for Collabs & Growth
119 Followers 98 Followinghttps://t.co/dSU2y1H9ie CSE (MAIT,DELHI) | Passionate about C++ & DSA | Frontend Web Developer | Exploring Open Source & Web3 | Learning every day 🌱
140 Followers 106 Following🚀 Full Stack Developer | MERN Stack | DSA Enthusiast | Problem Solver
Passionate about building scalable web applications and solving DSA problems
2K Followers 2K FollowingA JavaScript Junkie 💻| Documenting my journey in tech 📝 | Daily tweets about Web development ⌨️🤝| A Passionate Chess Player♟️.
18K Followers 16K FollowingFreeBSD advocate who is heavily into Ansible, BGP (AS20621), DevOps, Kubernetes, Proxmox, XCP-ng, Python, Rust & RISC-V and builds own decentralized solutions.
239 Followers 330 Following@NITRR || CSE || JAVA || DSA || WEB DEVELOPMENT || @LeetCode- 400+ Problem Solved || @HackerRank 5 Star in C & 4 Star in CPP
119 Followers 98 Followinghttps://t.co/dSU2y1H9ie CSE (MAIT,DELHI) | Passionate about C++ & DSA | Frontend Web Developer | Exploring Open Source & Web3 | Learning every day 🌱
84K Followers 120 FollowingSkill up with GeeksforGeeks for free 🥳💚| Daily DSA problems, Interview Prep resources, Premium Courses, Resources to learn ML & DS, & much more for you!
No recent Favorites. New Favorites will appear here.