Mrudul (@dev_mrudul) header
Mrudul (@dev_mrudul) profile picture

Aspiring Software Developer ⚫ Coding in C++ ⚫ Learning JS and Java

India
Joined October 2021
Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)Photo by Mrudul (@dev_mrudul)
LeetCode Problem 50. Pow(x, n) Implement pow(x, n), which calculates x raised to the power n (i.e., x^n). Sol : O(logn) time & O(1) space (Binary Exponentiation) #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
1
LeetCode Problem 134: Gas Station Given 2 arrays A & B, return starting index of circular path AB such that at no time summation(A[i]-B[i]) is negative Sol : O(n) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
2
3
Problem : Count Inversions Type (2) Link : leetcode.com/problems/global… Check if local and global inversions are different . Local Inversion : a[i]>a[i+1] Sol : O(n) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
1
1
This solution is tricky . Since array only contains numbers from 0 to n-1 (unique) and all local inversions are global inversions, we need to calculate a number which is displaced from its index more than 1 place i.e. abs(index-a[index])>1
Problem : Count Inversions in Array Two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j. Sol : O(nlogn) time & O(n) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
2
2
For people who are just learning to code, @freeCodeCamp is such a great resource. What other free resources would you recommend? Link them below 👇
15
6
1
46
Problem : Find Duplicate and Missing Number Constant array of n integers, each is in the range [1, n] inclusive. 1 integer is repeated and 1 is missing Sol : O(n) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
LeetCode Problem 287: Find Duplicate Array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. Sol : O(n) time & O(1) space (C++/Java) #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
3
5
LeetCode Problem 88: Merge Sorted Array Merge into 1 sorted array A1 .Extra space is given in A1 to hold both arrays A1 = [1,2,3,0,0,0] A2 = [2,5,6] Sol : O(m+n) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
3
3
LeetCode Problem : Check Valid Matrix An n x n matrix is valid if every row and every column contains all the integers from 1 to n (inclusive). Sol : O(n^2) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
1
XOR of ‘x’ with 0 is 'x' XOR of ‘x’ with itself even number of times is 0 XOR of ‘x’ with itself odd number of times is 'x' Do XOR of arr[i] with its index i+1 array=[1,2,3] then, [1^1^2^2^3^3]=0 so no duplicates array=[1,1,3] then, [1^1^1^2^3^3]!=0 so duplicates present
LeetCode Problem 56: Merge Intervals Given an array of intervals where intervals[i] = [start-i, end-i], merge all overlapping intervals Sol : O(nlogn) time & O(n) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
5
4
This problem has many interesting edge cases . We use prev and curr to keep track of our overlapped window and subsequently merge the intervals
My 2021 income streams: • video course: $78,620 • cohort course: $79,285 • ebook: $16,952 • cutting boards: $4,495 • membership: $29,895 • freelancing: $120,000 • affiliate sales: $2,020 • saas: $4,582 revenue: $335,849 profit: $304,498
166
197
40
4,003
Here is the correct roadmap for web development in 2022👇 1: HTML 🧱 2: CSS 🎨 3: CSS frameworks 🧮 4: JS ⚙️ 5: DOM 📃 6: Git and GitHub 🗂️ 7: React/Angular/Vue ⚛️ 8: Node.js 🔙🔚 9: API - @Rapid_API 🐙 10: Database 🗄️
90
625
26
2,730
LeetCode Problem 48: Rotate Image Given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). Sol : O(n^2) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
2
2
LeetCode Problem 121: Buy & Sell Stock Prices[i] is the price of a given stock on the ith day. Maximize profit by choosing a day to buy & other day to sell Sol : O(n) time & O(1) space #100DaysOfCode #programming #codingisfun #code #SoftwareEngineer #developers #problemsolving
1
2
1
Small and big track smallest and biggest seen during traversal . We also track the largest profit we have seen in each iteration . If we find a smaller number we update both small and big because as previous value of big is now useless . If we find a bigger value we update big
Replying to @faheem_khan_dev
haha I guess this can help you a little bit:😂 - Search for "add me to google" or "edit my people card" on google - Create your card - I've my card listed as below: 😅
1
4
26