uk
Feedback
Samri-A

Samri-A

Відкрити в Telegram

Hey, I’m Samri 🤗. in one word "someone curious" This channel is my log book.

Показати більше
Країна не вказанаКатегорія не вказана
302
Підписники
Немає даних24 години
+117 днів
+2330 днів
Архів дописів
long time no seen 😁 it's been months since I last touched data or ml
long time no seen 😁 it's been months since I last touched data or ml

As @sudojajos suggested, I will post like this. My plan was to post daily ,but at night I forget and end up sleeping 😥

If you’ve solved any of these, comment your approach 🙂

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 difference
2, 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 case
4, 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)

Repost from Po codes
Introducing የዝማሬ ማዕድ (YeZemare Maed) Selam everyone! 👋 During this Abiy Tsom, I really wanted a place to just listen to Orth
+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

try this problem , it is interesting

now I wont feel that dumb 😂

some good comments 😁
some good comments 😁

Eid Mubarak to all muslim friends 😊

Day 14: solved few leetcode problems

😊
😊

My phone just survived its second suicide attempt from about 1.6 meters off dorm bed ( aka top one ) Thought she can escape easily 😒

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

How do u deal with headaches? Except sleeping and using pills

got my first badge 😁
got my first badge 😁

Repost from Naol.Builds
May your day be amazing as you're

The course is interesting eko but the slides 😭 wth 🤦‍♀️

Before the exam cooks me ….
Before the exam cooks me ….

I am having aha time 😁

let's study OS .... I will drop interesting things here😌
let's study OS .... I will drop interesting things here😌