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 ๐
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 ๐
๐ญ6
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 ๐
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 ๐
๐คทโโ3๐1
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
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.
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.
โค3
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.
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.
โค5
Forwarded 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 ๐๐๐
Who is going to win?
Comment the score and if arsenal loses the correct predictions I will give him prize ๐๐๐
๐3โค1
The idea is to encode a list of strings into one string using
then 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.
length#word
then 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.
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:
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
โค3๐ฅ2
Idea Your Opinion Needed
Iโm thinking to start a small coding challenge in this channel.
๐ก If someone solves a problem, Iโll give50 Birr airtime
โ๏ธ No AI allowed
โ๏ธ Must explain the solution
Do you think this is a good idea and helpful?
Drop your thoughts ๐
Iโm thinking to start a small coding challenge in this channel.
๐ก If someone solves a problem, Iโll give
โ๏ธ No AI allowed
โ๏ธ Must explain the solution
Do you think this is a good idea and helpful?
Drop your thoughts ๐
๐3
Integer to Roman
I used a dictionary and looped from largest to smallest value. For each value, I keep adding the symbol while it fits in the number and subtracting it.
My mistake was thinking like a list and trying to index the number instead of using a greedy approach.
I used a dictionary and looped from largest to smallest value. For each value, I keep adding the symbol while it fits in the number and subtracting it.
My mistake was thinking like a list and trying to index the number instead of using a greedy approach.
๐ฅ4
Forwarded from shego.codes
๐
"God protect me from everyone's and my own stupidity."
#เฑจเงโ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ :ยจ ยท.ยท ยจ:
โ โ โ โ โ โ โ โ โ โ โ โ โ โ `ยท . ๐
"God protect me from everyone's and my own stupidity."
#เฑจเงโ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ :ยจ ยท.ยท ยจ:
โ โ โ โ โ โ โ โ โ โ โ โ โ โ `ยท . ๐
๐3
Forwarded from Birhan Nega
แฅแตแแต แฒแแฃ แจแฃแต แแแฉ แจแแแแแ focus แแแข pull request review แแตแจแ แแญ แแ แ แแแ แขแแญแ แถแ แแแแต แแญ แแแธแแญ แฅแแฝแแแแข แแแ
แแแต แ แฒแ แจแแแญแแแ แถแ แแแจแจแต แตแแฎแฅ แจแแ แแแญ แญแจแณแแข
แ แแ แ แแ แแฐแแ แญ แซแตแแแแแข แแฐแ แจแแแ แแแฐแแจแต แแแ แแแ แ แแ แต
แแแซแ แจแตแซ แณแแแต
แ แแ แ แแ แแฐแแ แญ แซแตแแแแแข แแฐแ แจแแแ แแแฐแแจแต แแแ แแแ แ แแ แต
แแแซแ แจแตแซ แณแแแต
๐3
Product of Array Except Self
I learned that instead of multiplying everything each time, we split it into left and right products.
What I understood:
My mistake I first tried brute๐ญ force instead of thinking in prefix/suffix way
๐ Use left and right products to solve in O(n) time.
I learned that instead of multiplying everything each time, we split it into left and right products.
What I understood:
* Left = product of elements before index
* Right = product of elements after index
* Answer = left ร right
My mistake I first tried brute๐ญ force instead of thinking in prefix/suffix way
๐ Use left and right products to solve in O(n) time.
โค4
Today I saw enough ๐ช
One CBE branch network down, another working fine like nothing happened.
Mobile banking broke after update, Play Store app missing, use 889 also not workingโฆ and the final solution was I donโt know.๐คทโโ๏ธ
At that point I chose my health and quietly walked away from the bank ๐๐โโ๏ธ
One CBE branch network down, another working fine like nothing happened.
Mobile banking broke after update, Play Store app missing, use 889 also not workingโฆ and the final solution was I donโt know.๐คทโโ๏ธ
At that point I chose my health and quietly walked away from the bank ๐๐โโ๏ธ
๐4