UI/UX is high demand skill for 2023
but most people don’t know where to start
So I built the Ultimate UI/UX Design Roadmap
100% FREE for the next 24hrs!
if you want? just:
1. RT
2. Reply "UI/UX"
3. Follow me (so I can DM you)
#Day8of50
Delete Middle Node:
Implement an algorithm to delete a node in the middle (i.e., any node but the first and last node, not necessarily the exact middle) of a singly linked list, given only access to that node
https://t.co/Bd2JVF5lYs
T.C of the func = O(1)
S.C = O(1)
AI age makes writing tests easier than ever!
I tried https://t.co/e7m73zpYAe on a sample code and it worked really well.
• Generates tests
• Covers edge cases
• Best practice, readability code suggestions
• Gives you the code explanation
And it's absolutely free!
#Day6of50
Remove Duplicates from a Linked List: Write code to remove duplicates from an unsorted linked list using a temporary buffer.
https://t.co/wan0DSV6yx
Time Complexity : O(N), where N is the number of elements in the linked list.
Space Complexity : O(N) as well
#Day5of50
String Compression: Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3.
If compressed_length >= input_length, return input.
#Day4of50
There are three types of edits that can be performed on strings: insert a character, remove a character, or replace a character. Given two strings, write a function to check if they are one edit (or zero edits) away.
Approach:
1. Convert the input string to a char array so it can be modified in-place.
2. Count the number of empty spaces.
3. Compute the newLength after replacement
4. Set newIndex = newLength - 1;
5. Iterate over the original array from the end.
6. Replace spaces with '%20'
#Day3of50: URLify
Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end to hold the additional characters, and that you are given the "true" length of the string.
Solution 2:
I. Create 2 integer arrays (separate for both arrays) of fixed size: 128/256 (as mentioned by interviewer)
II. Store the count of occurrence of each character for both strings in these arrays.
III. Compare the counts and return true if equal.
T.C = O(n)
S.C = O(1)
Solution 1:
I. Create a character array of the 2 strings -> 0(n)
II. Sort these character arrays -> 0(nlogn)
III. Check if the 2 sorted arrays are equal -> 0(n)
Time complexity: 0(nlogn)
Space Complexity: O(n)
*There is such a thing called “sweet success”, which is when you squeeze yourself with hard work for success, and then squeeze out your purse to buy sweets for others*
Surrounded by Idiots 📖
✅Chapter 1 : Communication happens on the listener's side
✅Summary : In the beginning of the chapter, author has beautifully put down the fact that one can't base the communication technique on the basis of your preferences.
Wasting time on distractions we’ll later regret leads to a life filled with missed opportunities.
Take control of your time today. Become Indistractable.