eninjain Profile Banner
Sanjay (eNinja-in) Profile
Sanjay (eNinja-in)

@eninjain

Followers
2
Following
456
Media
93
Statuses
94

Cybersecurity Enthusiast | Full stack Developer with DSA | Proficient in Python, C, C++ | GATE2025 (377) | Passionate Secure Web Solutions.

Joined June 2025
Don't wanna be here? Send us removal request.
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #82 Remove Duplicates from Sorted List Remove all duplicates from a sorted linked list, keeping only distinct numbers. Use a dummy node, traverse & skip duplicates, link unique nodes. Input: 1->2->3->3->4->4->5 Output: 1->2->5 βœ… O(n) time, O(1) space. #LinkedList
0
0
0
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #81 Search in Rotated Sorted Array Find a target in a sorted array rotated at a pivot. 🎯 Use modified binary search: check which half is sorted, then narrow search. Input: [4,5,6,7,0,1,2], target=0 β†’ Output: 4 βœ… O(log n) time, O(1) space. #BinarySearch #LeetCodeMedium
0
0
0
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #80 Remove Duplicates from Sorted Array Clean a sorted array so each element appears once! ✨ Use two pointers to overwrite duplicates in-place. Example: [1,1,2,2,3] β†’ [1,2,3], length = 3 βœ… Time: O(n), Space: O(1) #RemoveDuplicates #TwoPointers #LeetCodeEasy
0
0
0
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”₯ Networking Cheat Sheet β€” Hacker Edition πŸ”₯ 🧩 OSI & TCP/IP: instant recall 🌐 IPs: IPv4/IPv6 & private ranges πŸ”Œ Ports: FTP, SSH, DNS, HTTPS, RDP ⚠️ πŸ› οΈ Commands: ping,traceroute,netstat,nmap,curl,dig πŸ’» πŸ›‘οΈ Security: firewall, IDS/IPS, VPN πŸ” πŸ’€ Attacks & ⚑ Defenses
0
0
1
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #79 Word Search Find if a word exists in a 2D board by moving up/down/left/right. 🧩 ⚑ DFS + Backtracking β†’ mark visited, explore, unmark. πŸ“¦ Ex: board=[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word="ABCCED" β†’ true βœ… πŸ“Š Time: O(NM4^L), Space: O(L) #dfs
0
0
1
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #78 Subsets Generate the power set of an array 🎯 Using DFS + Backtracking, at each step you either include βœ… or exclude ❌ an element β†’ every path = new subset 🌟 Ex: [1,2,3] β†’ [], [1], [2], [3], [1,2], [1,3], [2,3], [1,2,3] βœ… ⏱ O(2^nΒ·n) | πŸ“¦ O(n) #DFS #Backtracking
0
0
1
@eninjain
Sanjay (eNinja-in)
1 month
πŸ”’ #77 Combinations Given n & k, return all k-number combinations from 1..n. ⚑ Use backtracking: build recursively, track current combo, add when size=k. πŸ“¦ Example: n=4, k=2 β†’ [ [1,2],[1,3],[1,4],[2,3],[2,4],[3,4] ] #Combinations #Backtracking #LeetCodeMedium
0
0
1
@eninjain
Sanjay (eNinja-in)
1 month
πŸ“ #76 Minimum Window Substring Find the smallest substring in s containing all chars of t. Use sliding window + char count array, expand right, shrink left to minimize. Ex: s='ADOBECODEBANC', t='ABC' β†’ 'BANC' O(n+m) time, O(128) space #SlidingWindow #LeetCodeHard
0
0
1
@eninjain
Sanjay (eNinja-in)
1 month
🎨 #75 Sort Colors FAST! πŸ”₯ Array of 0️⃣,1️⃣,2️⃣? Sort IN-PLACE like a boss! Use Dutch National Flag 3-pointer magic: push 0s front, 2s back, 1s chill in the middle. πŸ’¨ One pass | O(n) | O(1) #SortColors #LeetCode #CodingHacks #ArrayMagic
0
0
0
@eninjain
Sanjay (eNinja-in)
2 months
#74 Search 2D Matrix Matrix sorted row-wise & first of each row > last of prev. Find target βœ… ⚑ Trick: treat it as 1D β†’ Binary Search! row=mid/n, col=mid%n ⏱ O(log(mn)) | πŸ’Ύ O(1) #Search2DMatrix #BinarySearch #LeetCodeMedium #InterviewReady
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
#73 Set Matrix Zeroes 🟦 Given an mΓ—n matrix, if an element = 0 β†’ set its row & col to 0. ⚑ In-place, O(1) space: use 1st row/col as markers β†’ mark, zero out, then fix 1st row/col. πŸ“Š Time: O(mn) | Space: O(1) #SetMatrixZeroes #LeetCodeMedium #InterviewReady
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
✏️ #72 Edit Distance Find min ops to convert word1 β†’ word2 using insert, delete, replace. DP: dp[i][j] = min steps for first i,j chars. If same: dp[i][j]=dp[i-1][j-1], else =1+min(insert,del,rep). Ex: horseβ†’ros =3 βœ… ⏱ O(mn) πŸ’Ύ O(mn) #EditDistance #DP #LeetCode
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ›£οΈ #71 Simplify Path Simplify a Unix-style absolute path. / separates dirs, . = current, .. = parent. Remove extra slashes. Ex: "/home/"β†’"/home", "/a/./b/../../c/"β†’"/c" βœ… ⏱ O(n) | πŸ“¦ O(n) #SimplifyPath #StringParsing #LeetCodeMedium #UnixPaths #EdgeCases
0
0
2
@eninjain
Sanjay (eNinja-in)
2 months
πŸͺœ #70 Climbing Stairs Count ways to climb n stairs taking 1 or 2 steps at a time. Classic Fibonacci problem. Ex: n=2β†’2 βœ…, n=3β†’3 βœ… ⏱ O(n) | πŸ“¦ O(1) #ClimbingStairs #DP #Fibonacci #LeetCodeEasy #InterviewReady #MathAndSequences #EdgeCases
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ“ #69 Sqrt(x) Compute the integer part of √x (truncate decimals) for non-negative x. Use binary search for efficiency and avoid overflow. Ex: x=4β†’2 βœ…, x=8β†’2 βœ… ⏱ O(log x) | πŸ“¦ O(1) #Sqrtx #BinarySearch #LeetCodeEasy #MathAndBinary #EdgeCases
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ“ #68 Text Justification Format words into lines of length maxWidth. ⚑ Spread spaces evenly, put extra left, last line left-aligned. Ex: ["This","is","an","example","of","text","justification."],16 β†’ ["This is an","example of text","justification. "] βœ… ⏱O(n) πŸ“¦O(n)
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ’» #67 Add Binary Add 2 binary strings a & b βž• return sum in binary. ⚑ Only 0/1, handle carry & different lengths. βœ… "11"+"1"β†’"100" βœ… "1010"+"1011"β†’"10101" ⏱ O(max(n,m)) | πŸ“¦ O(max(n,m)) #AddBinary #BinaryMath #LeetCodeEasy #InterviewReady #CarryOver
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
βœ¨βž• #66 Plus One ✨ Increment a number stored as an array of digits πŸ”’. ⚑ Handles carry (9β†’10), no leading zeros (except 0). βœ… [1,2,3]β†’[1,2,4] βœ… [4,3,2,1]β†’[4,3,2,2] βœ… [9]β†’[1,0] ⏱ O(n) | πŸ“¦ O(1) #PlusOne #ArrayMath #LeetCodeEasy #InterviewReady #EdgeCases
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ”’ #65 Valid Number Check if a string is a valid number: int, decimal, or scientific (e/E), with optional +/-. Ex: "0"βœ… "0.1"βœ… "abc"❌ "1e10"βœ… "e3"❌ πŸ’‘ Trim spaces, handle sign, split num & exponent, validate parts. ⏱ O(n), πŸ—‚ O(1). #StringParsing #LeetCodeHard
0
0
1
@eninjain
Sanjay (eNinja-in)
2 months
πŸ›€οΈ #64 Minimum Path Sum Find the min path sum in an mΓ—n grid, moving only ⬇️ or ➑️. Ex: [[1,3,1],[1,5,1],[4,2,1]] β†’ 7 βœ… (path: 1β†’3β†’1β†’1β†’1) πŸ’‘ DP trick: dp[i][j] = grid[i][j] + min(top,left) ⏱ O(mn), πŸ—‚ O(mn)/O(n). #DynamicProgramming #LeetCodeMedium #InterviewReady
0
0
1