
Aspiring Software Developer ⚫ Coding in C++ ⚫ Learning JS and Java
India
Joined October 2021
- Tweets38
- Following88
- Followers9
- Likes110
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
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
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
Mrudul retweeted
For people who are just learning to code, @freeCodeCamp is such a great resource. What other free resources would you recommend? Link them below 👇
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
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
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
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
Mrudul retweeted
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
Mrudul retweeted
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 🗄️
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
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

ALT We make 2 variables small and big which 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
Mrudul retweeted
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: 😅

















