Samri-A
Открыть в Telegram
Hey, I’m Samri 🤗. in one word "someone curious" This channel is my log book.
БольшеСтрана не указанаКатегория не указана
302
Подписчики
Нет данных24 часа
+117 дней
+2330 дней
Архив постов
302
As @sudojajos suggested, I will post like this.
My plan was to post daily ,but at night I forget and end up sleeping 😥
302
Day 15 : Thursday
1, two city scheduling
First, I calculated the cost difference between the two cities and stored it with A and B values in a multi list. Then I sorted this list by their cost differences (so the large negative values appear first , for example, if city B costs 50 and city A costs 450, the difference relative to A is –350, so we prefer sending this person to B). After sorting, I assigned the first half of the list to the city used as the reference when computing the differences, and the remaining half to the other city. time : O(n log n) space : O(n) - used extra for cost difference2, Browser history
My approach : I used doubly linked list and for back function used prev method and for forward function next method time : O(steps) - for each function call space : O(1)3, Sub array sum div by k
this is prefix sum problem My approach : loop over the list and calculate prefix sums. In each step , store the current prefix sum modulo it in hash table and if the current modulo is already in the hash table , we take that frequency modulo to increase the subarray count time : O(n) space: O(n) - worst case4, Remove stars
this is stack problem my approach : loop over the string and push the characters until we find * and pop once. finally we pop everything to a string time : O(n) space : O(n)5, Recent calls
this is queue problem my approach : append the call range to the queue and if the left most ( the first ) element is not in the range of the current we dequeue that , and repeat until the first element is in the range of the current , and finally return the length of the queue time : O(1) ... but in worst case, we have to pop everything so it depends on length of the queue , idk how to express this tho space : O(1)6, DataStream
this is design problem my approach : initially, store the value in hashtable to count it's frequency we check if the number is equal to the value , if it does we increase the count if not we reset our counter to zero and if the current count is lessthan k return False else it is true time : O(1) space : O(1)7, Next greater
this is monotonic Stack problem my approach : I loop over nums2 from right to left and used a decreasing stack to track the next greater value to the right. For each number , I popped all smaller elements since they cannot be next greater for anything. The top of the stack is the next greater element , and stored this in hash table. Finally return the values from the hash using the nums1 values as a key time : O(n) space : O(n)
302
Repost from Po codes
+5
Introducing የዝማሬ ማዕድ (YeZemare Maed)
Selam everyone! 👋
During this Abiy Tsom, I really wanted a place to just listen to Orthodox Mezmurs peacefully with the lyrics, without getting distracted by recommendations, or cluttered UIs. I couldn't find an app that did exactly what I wanted... so I decided to fight with some scripts and build it myself!
The User Experience:
-Clean, distraction-free audio streaming.
-Fully categorized by Zemarian and Mezmur categories.
-5 different custom themes designed to feel natural and calm.
Still a work in progress!
• Around 75% of tracks don’t have lyrics yet
• Lyrics are being generated in the background (Gimini API + Telegram API + Youtube API)
Couldn’t wait ...wanted to share early and get your feedback 🙏
I’d love any ideas or improvements
Join @pocodes
302
My phone just survived its second suicide attempt from
about 1.6 meters off dorm bed ( aka top one )
Thought she can escape easily 😒
302
Day 13:
I finished half of the grokking algorithm book
Did some leetcode problems on graph and recursion
Started a project but I m not sure abt it
