CTRL + FUTUREš„
Kanalga Telegramāda oātish
Documenting my journey to becoming a Software Engineer Python | Web Dev | Problem Solving From beginner to developer š
Ko'proq ko'rsatishMamlakat belgilanmaganToif belgilanmagan
348
Obunachilar
+524 soatlar
+257 kun
+4330 kun
Postlar arxiv
Roman to Integer
I first used a dictionary to map each Roman symbol to its value, then I traverse the string one by one.
For each character, I get its value and try to build the total answer.
My main confusion was that I was only focusing on the current character. I didnāt realize I also need to compare it with the next character to decide whether to add or subtract.
Now I understand:
If current value < next value ā subtract Otherwise ā add
The idea is to encode a list of strings into one string using
length#wordthen decode it back by reading the length first and extracting each word. My mistake was mixing the logic in decode I tried to process the word while still searching for
#which caused errors. I learned that decoding must follow a clear order find # read length, extract word, then move forward.
Repost from Chapi Dev Talks
PSG Vs Arsenal
Who is going to win?
Comment the score and if arsenal loses the correct predictions I will give him prize ššš
Valid Palindrome
The idea is to first normalize the string by converting it to lowercase and removing all non-alphanumeric characters, then check if it reads the same forward and backward.
My main mistake was not clearly understanding how to properly clean the string, especially removing symbols and spaces. I also initially overcomplicated it using unnecessary loops.
In the end, I learned that the most important step is preprocessing the string correctly before doing the palindrome check.
Top K Frequent Elements
I used a dictionary to count how many times each number appears in the array. Then I sorted the frequency pairs in descending order and selected the top k frequent elements.
My main confusion was understanding how to sort the dictionary using the frequency values instead of the keys, especially the part with
lambda x: x[1]I also needed time to fully understand how result.items() becomes (number, result) pairs during sorting. This problem helped me better understand frequency maps and Top K patterns in problem solving.
Good morning guys āļø
I have a question for you all š
Do you learn for yourself, your future, and your dreams or mainly to make your family happy and proud?
Tell me your thoughts š
Today feels like April Foolās Day š
What is happening with our teacher?
That OOP exam was something else. I donāt even know what to say about the result it really wasnāt me š
Group Anagrams
I used a dictionary and grouped words by sorting each word to create a key. Words with the same sorted key are grouped together.
My main mistake was not realizing early that the sorted word should be used as the key, and I was a bit confused about converting the sorted list into a string and building the groups correctly.
Finally, I understood that anagrams become identical after sorting, so we can group them using that idea.
+1
Valid Anagram using two different approaches.
First, I compared both strings by sorting them and checking if the sorted versions are equal. If they match, it means both strings contain the same characters in the same frequency.
In the second approach, I first checked if the lengths are equal. If they are not equal, I immediately return False. Otherwise, I compare the sorted strings.
My understanding is that both solutions are correct, but adding the length check helps avoid unnecessary work when the strings are clearly not anagrams.
Contains Duplicate using a simple idea of storing seen values in a dictionary while traversing the array.
For each number, I check if I have already seen it. If yes, I return True because a duplicate exists. If not, I store it and continue. If the loop finishes without finding any repeated value, I return False.
My main mistake was in the logic flow I was returning False too early inside the loop, and I also forgot that I should check the actual values, not just the indices.
If you want to start learning DSA from the beginning, I recommend this NeetCode course. It explains the basics step by step and is good for beginners in competitive programming and problem solving
šTwo Sum Problem
I traverse the array one by one and for each element I calculate the complement (target ā current value). I store the values I have seen in a dictionary and check if the complement already exists.
If it exists, it means those two numbers add up to the target.
My main confusion was not the logic, but the return part the problem asks for indices, not the actual values.
This book is good start as beginner read and understand one algorithm or data structure then do easy then medium then hard problems from leetcode or codeforce
This summer, Iām continuing my Competitive Programming journey with more consistency and focus
Iāll be sharing:
⢠My LeetCode progress
⢠Codeforce problems & contests
⢠DSA concepts I learn
⢠Struggles, mistakes, and improvements along the way
The goal is simple improve step by step and become a better problem solver every day š»
If youāre also learning CP or DSA, feel free to join the journey.
EID AL-Adha hordoftootni amantii ISLAAMAA hundi keessan baga ittiin isin gahe ayyaana gaaariin isiniif hawwa šššš
