The scariest bug in production? Accidentally exposing sensitive data! Don't just hope you filtered your objects. Enforce it at the type level! Here's how TypeScript's Pick utility type acts as your security guard. It lets you create a "safelist" of properties. #code #coding #programming #softwareengineering
How TypeScript's Pick utility type protects sensitive data
More Relevant Posts
-
🔥 Day 76 of #100DaysDSAChallenge 📌 Topic: Dynamic Programming — Maximum Product Subarray ✅ Problem Solved on #LeetCode: 152. Maximum Product Subarray (🟠 Medium) 💡 Key Learnings: • Learned how to track both the maximum and minimum product at each index to handle negative numbers. • Understood how sign flipping (due to negatives) affects subarray products. • Strengthened dynamic programming concepts through continuous product tracking. • Improved ability to reason about edge cases and sign changes in subarray problems. 🚀 Consistency Matters: Every single day of coding strengthens logic, boosts problem-solving confidence, and deepens understanding. Keep pushing forward — small daily efforts create big results over time 💪 🏷️ #Day76 #100DaysChallenge #100DaysDSAChallenge #LeetCode #DynamicProgramming #ProblemSolving #Java #CodingChallenge #DataStructures #Algorithms #LearningJourney #Programming #Consistency #LogicBuilding #10kCoders #10000Coders
To view or add a comment, sign in
-
-
🔥 Day 70 of #100DaysOfCode 🔥 💡 Problem: Number of Steps to Reduce a Number to Zero – LeetCode ✨ Approach: A simple while loop logic — divide the number by 2 if it’s even, else subtract 1. Repeated until it hits zero. Clean, elegant, and lightning fast! ⚡ 📊 Complexity Analysis: Time Complexity: O(log n) – each division by 2 halves the number Space Complexity: O(1) – constant space ✅ Runtime: 0 ms (Beats 100%🔥) ✅ Memory: 41.95 MB 🚀 Key Takeaway: Sometimes, brilliance lies in simplicity — clear logic, powerful performance! #LeetCode #100DaysOfCode #ProblemSolving #CodingChallenge #Programming #DSA #LogicBuilding #Efficiency #CodeDaily #DeveloperJourney
To view or add a comment, sign in
-
-
📅 Day 50 of #100DaysOfCode Problem: Simplify Path (LeetCode 71) Approach: 1️⃣ Used a stringstream to split the path by '/'. 2️⃣ Ignored empty tokens and "." since they don’t change the directory. 3️⃣ For "..", popped the last directory from the stack (if any). 4️⃣ Rebuilt the canonical path from the stack in the correct order. #100DaysOfCode #LeetCode #DSA #ProblemSolving #Stacks #Cplusplus #CodingChallenge #Algorithms #Programming #DeveloperLife #CodingJourney #CodeNewbie #DailyDSA #SoftwareEngineering #KeepLearning #GrowthMindset #Motivation #TechCommunity #CleanCode
To view or add a comment, sign in
-
-
On Day 287 of my #300daysofcode challenge, I'm sharing my solution to LeetCode Problem 2125, "Number of Laser Beams in a Bank." This problem is an excellent example of a linear-time problem that requires careful state tracking. My video provides a clear walkthrough of this efficient method, which is a valuable skill for any developer and a great way to practice writing clean, logical code. #DataStructures #Algorithms #LeetCode #CodingInterview #Programming #ProblemSolving #300daysofcode
To view or add a comment, sign in
-
Leetcode problem solving day 85 today i solved problem number 34. Find First and Last Position of Element in Sorted Array link to problem - https://lnkd.in/gdNJs872 below is my approch used function findBound which takes three arguments: array, the target to search for, and a boolean value isFirst which indicates if we are trying to find the first or the last occurrence of target. used 2 variables to keep track of subarray that we are scanning begin and end. begin is set to 0 and end is set to the last index of the array. iterated until begin is greater than to end. at each step calculated middle element mid = (begin + end) / 2. used value of the middle element to decide which half of the array we need to search. nums[mid] == target isFirst is true ~ This implies that we are trying to find the first occurrence of the element. If mid == begin or nums[mid - 1] != target, then we return mid as the first occurrence of the target. Otherwise, we update end = mid - 1 isFirst is false ~ This implies we are trying to find the last occurrence of the element. If mid == end or nums[mid + 1] != target, then we return mid as the last occurrence of the target. Otherwise, we update begin = mid + 1 nums[mid] > target ~ We update end = mid - 1 since we must discard the right side of the array as the middle element is greater than target. nums[mid] < target ~ We update begin = mid + 1 since we must discard the left side of the array as the middle element is less than target. We return a value of -1 at the end of our function which indicates that target was not found in the array. In the main searchRange function, we first call findBound with isFirst set to true. If this value is -1, we can simply return [-1, -1]. Otherwise, we call findBound with isFirst set to false to get the last occurrence and then return the result. Time complexity : O(log n). Space complexity : O(1) #DSA #Programming #LeetCode #ProblemSolving #CodingJourney #TechCommunity
To view or add a comment, sign in
-
-
📅 Day 49 of #100DaysOfCode Problem: 3228. Maximum Number of Operations to Move Ones to the End (LeetCode) Approach: 1️⃣ Keep a counter of how many '1's you’ve seen as you go through the string. 2️⃣ When you see a '0' that’s right before a '1' or at the end, you can “move” all those previous '1's past this '0' — so add that counter to the result. 3️⃣ Every time you hit a '1', increment the counter; for '0', check the condition and reset logic as needed. 4️⃣ Return the total operations counted — it’s just one pass through the string = O(n) time, O(1) space. #100DaysOfCode #LeetCode #DSA #ProblemSolving #Cplusplus #Algorithms #Greedy #CodingChallenge #Programming #DeveloperLife #CodeNewbie #DailyDSA #SoftwareEngineering #KeepLearning #TechCommunity #GrowthMindset #Motivation
To view or add a comment, sign in
-
-
📅 Day 44 of #100DaysOfCode Problem: Minimum Number of Operations to Make Array Continuous (LeetCode 2009) Approach: 1️⃣ For each element, assumed it to be the starting point of the range. 2️⃣ Calculated what the range should end at → start + n - 1. 3️⃣ Iterated over all numbers, counted how many don’t fit in this range (those need to be replaced). 4️⃣ Kept track of the minimum replacements across all possible ranges. #100DaysOfCode #LeetCode #DSA #ProblemSolving #Cplusplus #Algorithms #CodingChallenge #Programming #DeveloperLife #CodeNewbie #DailyDSA #SoftwareEngineering #CodingJourney #TechCommunity #KeepLearning #GrowthMindset #Motivation #LearningInPublic
To view or add a comment, sign in
-
-
🚀LeetCode #5 – Longest Palindromic Substring (C++ Solution) Just solved LeetCode Problem #5 — one of those classic challenges that really tests your understanding of string manipulation and dynamic programming. This problem made me slow down and think carefully about how to expand around centers efficiently and optimize without brute force. It’s a great example of how small improvements in logic can drastically change performance. 🧠 Concept: Find the longest substring that reads the same forward and backward. Approach used: Expand Around Center — checking every possible center in O(n²) time but with constant space. 💻 Tech Stack: C++ ⚙️ Focus: Optimization, logic clarity, and clean code structure. Every problem like this strengthens how I think about data patterns — and that’s exactly the kind of mindset I bring into real game logic and system design. #LeetCode #Cplusplus #Coding #ProblemSolving #GameDev #Programming
To view or add a comment, sign in
-
-
Optimizing Path Traversal with Path Compression 🔄 Join Richard Feldman to demystify type inference by building it yourself. Implement the Hindley-Milner system, parse code, resolve scope, generate bytecode, and create a type system from scratch. https://lnkd.in/gQ2iHXFw #WebDev #Programming #Coding #LearnToCode #CompilerDesign
To view or add a comment, sign in
More from this author
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
Exactly! 🛡️ TypeScript’s Pick is like having a bouncer at the club door only the properties you explicitly allow get through. It’s a simple but powerful way to prevent accidental leaks of sensitive data, enforce compile-time safety, and reduce those “oops” moments in production. Danny Thompson