#leetcode problems
Explore tagged Tumblr posts
Text
I have no motivation to work on the type of code that will get me a job. Instead I'm wasting all my time writing the type of code that I'd write on the job
#codeblr#progblr#i hate leetcode problems so much#i cant figure them out#theyre frustrating#id rather work on my real app that i really use every day#will never get a job if i keep focusing on app development instead of leetcode practice
60 notes
·
View notes
Text
.
#me doing my silly little leetcode problems and my silly little interview prep#while tech companies mass layoff in favor of AI and outsourcing to 3rd world countries#and word at my own company is they prefer to hire in their locations in [countries where the equivalent salaries are half of US salaries]#this_is_fine.gif#I’m secure in my current role and recently got a promotion#But still#negativity cw#financial cw
3 notes
·
View notes
Text
sitting in my room living the gamer lifestyle (doing leetcode problems)
#been getting into competitive programming recently#i was on codeforces (my ranking is shit bc i spent the whole contest on one problem bc i had to rewrite it in a diff language..)#but i heard people use leetcode too so i got an acc there too#iso.txt#i can solve the problems easily (the ones ive seen) but idk some basic syntax stuff so i fuck up lol
4 notes
·
View notes
Text
online applications for cs jobs are so ridiculous you're telling me i have to spend 4 hours of my life doing this thing that will make me miserable? and if i dont do it in a way that you exactly like you'll waste my time and ghost me? what if we both became shooting stars passing in the night
#rambles#why is every application turning into a full on exam. i hate the grind so much#i dont WANT to do leetcode problems i dont WANT to sign up for your stupid online application site so i can do this thing and fail it#this one im doing rn is making me download a fucking app? a whole program onto my computer?? bro.#last time i did an online app i failed the code section but a bunch of ppl passed with chatgpt so they had to do another interview round#so now im kinda jaded abt it like. what's the fucking point man#on one hand i get it. from the employer perspective it's good for identifying who wants to actually work there#but like. come on. this is so ridiculous
1 note
·
View note
Text
242. Valid Anagram
New Post has been published on https://freelancingdiary.com/242-valid-anagram/
242. Valid Anagram
Problem
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1:Input: s = “anagram”, t = “nagaram” Output: true
Example 2:Input: s = “rat”, t = “car” Output: false
Constraints:
1 <= s.length, t.length <= 5 * 104
s and t consist of lowercase English letters.
Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?
Solution
First attempt : (Non optimized)
/** * @param string s * @param string t * @return boolean */ var isAnagram = function(s, t) const sset = s.split(""); const tset = t.split(""); if(s.length == t.length) for(let i = 0 ; i < sset.length; i++) let value =sset[i]; if(tset.includes(value)) let index = tset.indexOf(value); tset.splice(index,1) else return false; else return false; return true ;
After giving it a second attempt I tried optimizing it further and here is what I have done so far :
/** * @param string s * @param string t * @return boolean */ var isAnagram = function(s, t) let ss = s.split(""); let tt = t.split(""); const dict = if(s.length == t.length) for(let i = 0 ; i < ss.length; i++) if(dict[ss[i]]) dict[ss[i]]++; else dict[ss[i]] = 1; for(let y = 0 ; y < tt.length; y++) if(dict[tt[y]]) dict[tt[y]]--; else return false; else return false; return true ;
0 notes
Note
Hey not to go all "tumblr is a professional networking site" on you, but how did you get to work for Microsoft??? I'm a recent grad and I'm being eviscerated out here trying to apply for industry jobs & your liveblogging about your job sounds so much less evil than Data Entry IT Job #43461
This place is basically LinkedIn to me.
I'm gonna start by saying I am so so very sorry you're a recent grad in the year 2024... Tech job market is complete ass right now and it is not just you. I started fulltime in 2018, and for 2018-2022 it was completely normal to see a yearly outflow of people hopping to new jobs and a yearly inflow of new hires. Then sometime around late-spring/early-summer of 2022 Wallstreet sneezed the word "recession" and every tech company simultaneously shit themselves.
Tons of layoffs happened, meaning you're competing not just with new grads but with thousands of experienced workers who got shafted by their company. My org squeaked by with a small amount of layoffs (3 people among ~100), but it also means we have not hired anyone new since mid-2022. And where I used to see maybe 4-8 people yearly leave in order to hop to a new job, I think I've seen 1 person do that in the whole last year and a half.
All this to say it's rough and I can't just say "send applications and believe in yourself :)".
I have done interviews though. (I'm not involved in resume screening though, just the interviews of candidates who made it past the screening phase.) So I have at least some relevant advice, as well as second-hand knowledge from other people I know who've had to hop jobs or get hired recently.
If you have friends already in industry who you feel comfortable asking, reach out to them. Most companies have a recommendation process where a current employee fills out a little form that says "yeah I'd recommend such-and-such for this job." These do seem to carry weight, since it's coming from a trusted internal person and isn't just one of the hundreds of cold-call applications they've received.
A lot of tech companies--whether for truly well-intentioned reasons or to just check a checkbox--are on the lookout for increasing employee diversity. If you happen to have anything like, for example, "member of my college Latino society", it's worth including on your resume among your technical skills and technical projects.
I would add "you're probably gonna have to send a lot of applications" as a bullet point but I'm sure you're already doing that. But here it is as a bullet point anyway.
(This is kind of a guess, since it's part of the resume screening) but if you can dedicate some time to getting at least passingly familiar with popular tech/stacks for the positions you're looking into, try doing that in your free time so you can list it on your resume. Even better if you make a project you can point to. Like if you're aiming for webdev, get familiar with React and probably NodeJS. On top of being comfortable in one of the all-purpose languages like C(++) or Java or Python.
If you get to the interview phase - a company that is good to work for WILL care that you're someone who's good to work with. A tech-genius who's a coworker-hating egotistical snob is a nuisance at best and a liability at worst for companies with even a half-decent culture. When I do interviews, "Is this someone who's a good culture fit?" is as important as the technical skills. You'll want to show you'll be a perfectly pleasant, helpful, collaborative coworker. If the company DOESN'T care about that... bullet dodged.
For the technical questions, I care more about the thought process than I do the right answer, especially for entry-level. If you show a capacity for asking good, insightful clarifying questions, an ability to break down the problem, explain your thought process, and backtrack&alter your approach upon realizing something won't work, that's all more important than just being able to spit out a memorized leetcode answer. (I kinda hate leetcode for this reason, and therefore I only ask homebrewed questions, because I don't want the technical portion to hinge at all on whether someone managed to memorize the first 47 pages of leetcode problems). For a new hire, the most important impression you can give me is that you have a technical grasp and that you're capable of learning. Because a new hire isn't going to be an expert in anything, but they're someone who's capable of learning the ropes.
That's everything I have off the top of my head. Good luck anon. I'm very sorry you were born during a specific range of years that made you a new grad in 2024 and I hope it gets better.
321 notes
·
View notes
Note
What other hobbies do you have in life besides BDSM Art, Anime and Videogames?
I really like music! I've been doing music-related stuff since I was in elementary school. I can play a couple of instruments, I like to sing, I know my way around a DAW and I've produced some stuff of my own under a different name.
I also like to dance. For the past couple of years I've been secretly teaching myself stuff from YouTube tutorials. I'm way too shy to do it in front of anyone else though. I literally only do it in my basement with cardboard duct taped over the windows lol. When my wife saw the cardboard she got scared because she thought someone had broken into our house or something.
This one is really weird and nerdy, but I used to mess around with prediction markets a lot and consistently made money on PredictIt back when it was more active. It was very stressful and distracting. Now I just buy index funds and sleep much better at night.
I like to program. Sometimes I do problems on leetcode just for fun. For a while I've also been working on making my own (not-kink-related) game off-and-on. It's a total mess but maybe someday I'll throw it up on Steam. 🤷♀️
I actually don't watch very much anime. The last series I got really into was Cyberpunk and that was already a couple of months ago for me!
36 notes
·
View notes
Text
Dec. 16, 2024
Day 9/150 Days of Growth
Today was another quiet, gloomy, cold day so I spent the entirety of it in my room with a candle on and a warm peppermint latte 🤎 Been on a study-call with my best friend for the past 6 hours, so I got extra done today.
What I did today:
☕3 units of Azure exam prep ☕A LeetCode problem about dividing strings ☕30 minutes of GMAT math prep using the Princeton review ☕Packed my bags, cleaned my room ☕Did my hair and lots of skincare ☕Created a video and written tutorial at work for a colleague ☕Spent overtime fixing their system :?
Tomorrows targets:
🕰 1 hour of Azure exam prep 🕰 30 more minutes of GMAT prep from the Princeton book 🕰 Another work party + some pictures at the Christmas market :) 🕰 Start on re-booting my portfolio in Python 🕰 Read a few more chapters of SmartCuts (genuinely such a powerful book by Shane Snow) 🕰 30 minute workout 🕰 One more Python Leet Code
Playlist for the day:
youtube
#academia aesthetic#academia#academic#academia moodboard#academic burnout#academic assignments#academic romance#academic disaster#academic validation#academic victim#chaotic academia#chaotic academic aesthetic#christmas#study blog#study aesthetic#study hard#study inspiration#study tips#study with me#studyblr#studyspo#becoming that girl#becoming her#it girl#pinterest girl#Youtube
24 notes
·
View notes
Text
leetcode
i dont get practicing by using leetcode over projects why cry over one small problem when you can cry over a dozen interwoven ones at the same time? i thought computer scientists liked efficiency
#codeblr#coding#programming#progblr#multiprocessing is when you cry over multiple problems in parallel
252 notes
·
View notes
Text
I Have No Job, and I must C++
Yes this is an obvious grab for praise for solving a leetcode easy.
Nevertheless, I feel like "literally the best attempt anybody ever made" is uh... It's pretty good.
It's not even my best because I think I have a dodge against an adversarial input that will speed it up significantly.
(and I haven't started parallelizing the problem yet)
32 notes
·
View notes
Text
December 9th, 2024
Studying for the GMAT (MBA Admissions Test) day 9/150
Today was a rainy, relaxed study day-I only really did review and finished up the chapter of the Princeton Review Book that I was on. It was relaxed to the point where I'm not sure if I should actually include this as a studying for GMAT day.
I attempted one of the LeetCode problems that I was working on, but ultimately I'm stumped and hopefully sleeping on it will help. The LeetCode 'easy' tags are so misleading smh.
The rest of the day was full of doing my nails and baking for the potluck tomorrow-I make churros for every single potluck I've been to but considering I have to be at work the whole day I made a caramel flan instead.
What I got done today:
Princeton Review finished up current chapter on arithmetic math
Once again reviewed equation substitution because I'm really not understanding the way the GMAT phrases the questions
Attempted some LeetCode problems
Painted my nails a Christmas theme and considering I broke one nail I slapped on a press on nail for that one finger
Baked a caramel flan which is still steaming
Playlist for the day:
youtube
#baking#canIchangemymajortobaking#studyblr#study blog#daily journal#study motivation#dark academia#studyspo#light academia#to do list#coding#langauge learning#studying#chaotic academia#chaotic thoughts#gmat exam#gmat preparation#study aesthetic#Youtube
12 notes
·
View notes
Text
hmm. i should try leetcode shouldn't i. they're gonna make me do a bunch of stupid problems at job interviews to prove i didn't chatgpt my degree arent they
7 notes
·
View notes
Note
hi there, i'm trying to get into the coding community so to speak. what sites can i join to discuss/do coding related stuff? I know about stack overflow, github and leetcode but i'm sure there are more, do you have any advice on which spaces are worth joining? thanks!
Communities To Join For Coding/Programming
Yeah I can help! In terms of "which spaces are worth joining" would depend on you. What I see as a place worth joining is a place where I can teach others - I like giving knowledge back on what I learnt so some places that I listed don't work well for me to do that and some others I prefer the most like the discord servers I'll mention. So, you'll have to skim through these and see if they're something you like!
Anyhoo, here are some places I found:
Reddit: There are many subreddits dedicated to coding, such as r/learnprogramming, r/coding, and r/programming. You can also find subreddits dedicated to specific programming languages or technologies so you can get specific help or provide the help to those languages etc.
Codecademy Forum: They have a forum and a discord server where you can talk about the courses and get buddies to do projects together who are at the same level as you!
FreeCodeCamp Forum: This website offers free coding lessons and projects, and also has a community forum where you can ask for help and connect with other learners. I met 2 developers from there who helped me a lot.
Dev.to and Medium: Both a community where developers come to share their knowledge and experiences through blog posts and discussions. Developers sometimes gain good writing experience by writing these posts (great way to move towards being a technical writer). I've made a Dev.to account and I'm slowly adding my programming posts from here to there and I want to start using Medium too 🤔
Discord: There are many Discord servers dedicated to coding, where you can join discussions and get help with coding problems. I made a whole post with a list of discord servers I'm part of and would recommend it if you want to get into it! I made lots of developer friends from the discord servers. Intimidating at first but slowing you'll like it I think! I'm mostly there to help people with HTML and CSS problems and you can help people the same with whatever. you're strong in!
In the end, the websites and communities you choose to join will depend on your interests and goals. I recommend exploring a few different options and finding the ones that work best for you - I did that and I preferred the discord servers over the subreddits 😅
Good luck with your coding journey! 😸👍🏾💗
#my asks#coding#programming#studying#codeblr#progblr#studyblr#reddit#Codecademy#freecodecamp#dev.to#comp sci#computer science#discord#discord servers#programmer
192 notes
·
View notes
Text
Oh my god I'm actually doing a leetcode-y algorithm problem for a real need, for like the first time in my career. And I think it needs dynamic programming even!
(The issue is, I have a set of "sessions" consisting of a start time plus a duration, and I want to know the max number of concurrent sessions. I have a vague memory that I've even seen this exact problem-- except rephrased as line segments of start point plus length-- in Cracking the Coding Interview or something)
42 notes
·
View notes
Text
Coding Update 7
I'm gonna try to keep this blog updated at least once a week so I make sure I'm always doing SOME sort of coding.
Something something read more.
So the Alien Invasion game is coming along pretty well. I'm learning a lot of tools very quickly. Which also means I'm forgetting a lot of stuff quickly sometimes haha.
So here's some of it. AlienInvasion is basically the whole game stuff, including all the sprites and other key information. It had me do a lot of creating Classes in separate files, then importing them into the main file to keep things clean. Which I get is mostly to keep everything clean and organized.
I'm also, as a full disclosure, mostly just writing the code it wants me to write. So this isn't wholly my own or anything.
Also I have NO idea what sprite group is. I think, if I'm understand it right, it's basically creating a stored group/list thing for the bullets and aliens?
Also there's this. The super().__init__() . I have, literally, no idea why that gets called. It never explained it or made an reference to why its used in the Sprite function. It just said "we call super() so it works properly" and I was like but WHY?? What does it MEAN??
I still don't know.
Also as you can see here, this is everything slimmed down to make the code easier. It had me write out what each of those events do first, under run_game(self), then it was like "we'll refractor this so the code is easier to read." Plus it makes it 100x easier to adjust the code.
I could go into the specifics of them but nah. Just know that they do what they are supposed.
Though while writing the bullet function, it originally let me spawn as many as i wanted as i spammed Spacebar. As I was testing it, I was like "huh.. Those bullets are off screen but I'm pretty sure they still exist. Which means eventually this will be a huge problem." And sure enough, the next part was like "those bullets will add up and slow down everything, so let's fix that." Which means I'm at least thinking about the right things sometimes! Yippie!
So as of right now: I have a moving ship, a bunch of aliens, the ability to shoot up to 3 bullets on screen, and I can close the game. The next part I think is making the aliens move and get blown up!
I did have a hard time doing the on-your-own problem though. It wanted me to create a bunch of stars, like I did the aliens, which worked fine AT FIRST. But then it wanted me to randomly space them, so it looked more like a real night sky.
The problem? If a star spawned outside the borders of the game, my whole thing FROZE. It became completely unresponsive. I also couldn't figure out how to get it to choose a random number for EACH star. It basically chose a random number when loaded and stuck to it.
I ended up looking up the code for how they did it, but i still didn't really understand it. Oh well. I'll go back to it some other time.
I also tried to do an easy Leetcode problem, the famous "two sum" interview question. Basically, it needs to pull numbers from a list to add up to the target sum, then print out their location within the list. so if its two numbers that equal 9, and they are in the list spots 0 and 4, it'll print [0, 4].
I know WHAT it wants me to do, and I know WHAT i want IT to do, but not HOW to do it. Which...made me really frustrated. I think its just cause I don't know how to use sorting algorithms, or any of the search ones. Which is a whole nother beast to manage. I'm honestly not sure how to even APPROACH that. Or where to study it. So I'm putting a pin in it for now.
I think I might learn some of it when I do some of the other projects, but I guess we'll find out. If anyone has any advice to learn that stuff please feel free to send it my way.
I think the other thing is it's gonna start making me think in math terms I don't know or understand. Like I was watching a show about programming and they were talking about uh.. Lambda math or something? and I was like "nope I have no idea what you are referring to." I'm under the impression I might be OKAY without knowing a ton of math, but uhhhh. We'll see I guess?
Anyway, I'll keep you posted. The most important part is ya gurl isn't giving up. We gonna do it to win it!!!
-Kit
7 notes
·
View notes
Text
A LLM got 12th in a Leetcode coding contest (probably)
In Weekly Contest 344, a fresh account (gogogoval) solved all 4 problems in 12:13 with commented submissions and test cases that look a lot like LLM code.
This could've been faked, but I doubt it. There are a small group of people in the world (a thousand, maybe) who could solve this contest fast enough to get 12th and add comments (or solve the problems and then feed it to a LLM to add comments), but it would be a very odd thing to do on a fresh account. The code itself also looks like LLM code - it uses techniques like gets on dictionaries (instead of using defaultdicts like most competitive python programmers).
This isn't that impressive. Leetcode contests are pretty easy, and this was an unusually easy contest - all four of the problems are rated easy or medium. Leetcode contests at the top level are about speed, not depth of understanding, so it's not that shocking that a LLM could do very well.
It's still a pretty massive leap. The free version of ChatGPT can solve two of these questions with some prodding, but it's pretty helpless on the other two. In particular, the last problem (the paths through a binary tree) is not trivial - it took me about ten minutes to find and implement a solution last night, and I'm pretty good.
This isn't that big of a deal for competitive coding, but it is a big deal for both Leetcode and the online assessments companies give. I don't know how much prompting or bugfixing it took the human who submitted this code to get the LLM to a correct solution, but either way, it changes the game on how we think about easy problems. We've gone from models that were very dull to a model that could probably pass the first round of a FAANG interview for a new grad. Already, in the week after, a skilled coder used a LLM to solve the first two questions of the Leetcode contest while solving 3 and 4 manually, saving a bunch of time and getting rank 5 in the contest. Easy questions aren't useful discriminators anymore.
This is the first thing I've seen a LLM do that genuinely impressed me. We are steadily approaching a point where either the improvement will slow or these things will have massive economic impact, and I have no idea which will happen.
122 notes
·
View notes