[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor acceptance emails will be sent out over the coming weeks. Make sure to check your spam folder!


[Advertise on 4chan]


File: 1781760291761926.png (344 KB, 640x984)
344 KB PNG
prev >>109086936
>>
File: 20260619_190856.jpg (214 KB, 1080x1430)
214 KB JPG
>>
File: 20260528_205832.jpg (203 KB, 1142x1523)
203 KB JPG
>>
File: 20260518_192359.jpg (335 KB, 1536x2048)
335 KB JPG
>>109096253
You have to solve this problem before replying.

Given n non-negative integers representing an elevation map where the
width of each bar is 1, compute how much water it can trap after raining.

Example 1:
    Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6

Example 2:
    Input:  height = [4,2,0,3,2,5]
Output: 9

Constraints:
    n == height.length
1 <= n <= 2 * 10^4
0 <= height[i] <= 10^5


from typing import List

class Solution:
def trap(self, height: List[int]) -> int:
# Your solution here
pass

if __name__ == "__main__":
s = Solution()
assert s.trap([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]) == 6
assert s.trap([4, 2, 0, 3, 2, 5]) == 9
assert s.trap([]) == 0
assert s.trap([5]) == 0
print("All tests passed!")
>>
>>109096299
from typing import List

class Solution:
def trap(self, height: List[int]) -> int:
n = len(height)
if n < 3:
return 0

left, right = 0, n - 1
left_max, right_max = 0, 0
water = 0

while left < right:
if height[left] < height[right]:
if height[left] >= left_max:
left_max = height[left]
else:
water += left_max - height[left]
left += 1
else:
if height[right] >= right_max:
right_max = height[right]
else:
water += right_max - height[right]
right -= 1

return water


if __name__ == "__main__":
s = Solution()
assert s.trap([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]) == 6
assert s.trap([4, 2, 0, 3, 2, 5]) == 9
assert s.trap([]) == 0
assert s.trap([5]) == 0
print("All tests passed!")

How it works (quick intuition)

You only need to know the tallest bar to the left and the tallest bar to the right.
Water above a bar = min(left_max, right_max) - height[i].

The two‑pointer trick works because:

The smaller side (left or right) determines the water level.

Move the pointer on the smaller side inward.

Update maxes as you go.

Add trapped water whenever the current bar is below the max.

This avoids building arrays and keeps memory O(1).
Want to explore more variations?

You can dive deeper into:

two pointer patterns

monotonic stack solution

visual explanation

If you want, I can also generate a step‑by‑step trace for any input.
>>
>"-Son, I'll be 35min late, sorry. We can go and buy you a new bike and then we can ride them.
>How does that sound?
>- But Dad, how are you going to post rage bait content from LinkedIn on /g/ if we do that?"
>>
>job is somewhat satisfying
>get paid decently well
I'm still unfulfilled. I need a hug once in a while
>>
File: mobydick.jpg (118 KB, 1280x720)
118 KB JPG
I'm a little anxious or even upset that I have to support a system that does stuff I don't understand. IT support is one thing, but when I get a note that some system doesn't work, I don't know how it's supposed to work. On my end it shows green, and I feel bad that I don't understand what the actual problem is once the operators use it and say that they have nonsense data coming out of it.
>>
File: 1571899751207.jpg (537 KB, 1280x1280)
537 KB JPG
>tfw
>"it's a known issue. I can't help you."
>>
>>109096592
>be grifter
>grift
>”wah i feel bad”
>>
File: two sides.png (2.44 MB, 1125x1119)
2.44 MB PNG
>>109096603
>be grifter
We're mercenaries; not heartless.
>>
I got monkey pawed. I was always big into flight and now I work at a helicopter school supporting the non-flight parts. This is an angel's dance and I never even learned a basic watlz.
>>
I'd never heard of a "Real-time OS" before getting my current job. Is that something they teach in school now? I'd have figured that if you need high-speed translation of output from sensors or output to actuators it would be handled by the non fp equivalent of an fpga. individual transistor level shit, at most analog signal processor level shit. but now people in general are expected to have intimate knowledge of specific real-time OSs that aren't available to the consumer market, apparently. How do employers expect people to have 99 years experience with shit like vxworks? never heard of that shit before getting into the field, and can't even easily find other examples of it that aren't from the 70s
>>
File: 4444.jpg (13 KB, 266x201)
13 KB JPG
>be me
>study engineering bc it was the meme choice back then
>3 years to get an internship
>difficult inferno to get a job
>gave up on this path, although i enjoyed studying eng
>move to data analysis because big data was big back then
>enjoying this new path
>1 year trying to get a job and it is impossible even doing my best (learning things, doing proejct, improving my soft skill lmao, lying better)
>got a job but was fired even i was an exemplary corpo drone back then
>difficult very hard to get a job
>gave up on this path, although i enjoyed playing with excel
>move to soft eng
>struggled a ton but i picked up fast
>enjoying working on this for years
>i see people coping hard with muh i fix allucinations, but i know architecture, ai will require a supervisor forever, but i do agent engineering and all other copes
>i will quit this trash but this time choose some low end job or physical job that doesnt involve pcs
also
>was in top 15-10% income for my country
>never managed to enjoy things money can buy like restaurants and trips
>i dont care about watches, knowing places, clothes, cars, a big home, starting a family, owning a big home, retiring at 40 and all these things the goy dream about
>my only motivation to get money was more money = more women, which is totally not true
>i can live like a hobo alone and be happy
>>
>>109096727
>>study engineering
based traffic engineer
>>
>>109096726
>skiddo cant find the docs
KEK WHAT A BITCH
>>
>>109096726
Your so fucking retarded. Just stop posting.
>>
File: 1761107829173323.png (11 KB, 104x98)
11 KB PNG
I'm so unbelievably retarded I get filtered by LC easy
I'm not sure I could manage stacking boxes or cleaning the streets without fucking it up
>>
File: 1675565073469.jpg (429 KB, 1050x1400)
429 KB JPG
>fretting about leetcode
i should ask the actual engineers at work if theyve ever done that shit.
>>
File: continues to take it.jpg (174 KB, 1280x881)
174 KB JPG
What I'm mad about in the places I've worked is that there is no growth. Things are as they are, people complain, and anyone who does anything about it is suppressed, and anyone who proposes making changes "properly" through the right channels are denied. It's all stagnant. Things fail, the solution is not obvious but people on the ground have ideas, and it's all kiboshed before it starts. I'm sure anyone who has been in the workforce for a while is used to it, but it's still frustrating. I know it can't be a wild west of people doing nonsense just to do it, but things have grown too safe and secure. Sometimes things just fucking suck and a tech or two and 50$ can make it better. Do it in a test environment. Have a real engineer certify it later and re-implement it in prod. Let people have fey moods.
>>
New job alert! TC increase of 50% not including bonus
Locking myself into being an SET for a few years but whatever, I will be rich.
>>
give me a fucking job aaaaaaaaaaaAAAAAAAAAAAAAAAA
>>
>>109097070
No :)
>>
>>109097070
*gives you a job* Here you go, anon. Welcome to 9-5 hell. Now you're one of us.
>>
>>109097070
I would but I'm still looking for funding to be able to afford some 4chan fags and make my dream of taking all the misfits to build something great!
>>
>>109097070
Join the military. Hell any military of the shit country you are likely from.
>>
I'm feeling uneasy about AI. It is not even about concrete things like job security, it's something more general.
I'm not a "coder" as such, more a jack-of-all-trades in the architecture layer, doing business-bridging stuff, infrastructure troubleshooting, that kind of thing. So why not just tell myself "it was never about coding"? That part is true, but the unsaid part is "AI can also do more than just the coding". Sure, maybe GPT-3.5 couldn't do it all, and Opus 4.8 can't either, but the capabilities keep evolving. And my honest view is that actually AI can do lots of things, and that many of the "SWE-things" people tend to say it can't do, it actually can, with proper use. Many will say "there will still be some X left", the unsaid part is that X is changing and that whatever X remains, feels less and less like computer science or technology-related which I suppose was a driver for many of us who went in, even if we weren't there for typing in the braces themselves.
>>
>>109098007
If it ends up being that good, we are all fucked anon. Not just the tech people. And then we'll see very fun and interesting times. Remember how nothing ever happens though.
>>
>>109096284
The women in my office are much more attractive.
>>
>>109096846
I found a place that isn't like this and tolerate being paid 30% less than my last job because it's so nice being able to just fix things.
>>
>>109096726
>I'd never heard of a "Real-time OS" before getting my current job. Is that something they teach in school now
Yes, we learned FreeRTOS. Don't act like a rudimentary OS with basic support for interrupt-driven tasks is that complicated a concept.
>>
File: 1771346045285746.jpg (62 KB, 421x421)
62 KB JPG
Has anyone worked as an SWE for Microsoft? Just got the offer and I'm wondering what I'm getting into.
>>
>>109098330
Depends entirely on what organization/product you'll be working in.
>>
Need some career advice
>Masters in Electrical Engineering (Systems and Control), good uni, good grades.
>Started research grant before finishing dissertation (during covid)
>Worked on research for 1.5 years
>Got depressed from never finishing dissertation
>After grant ended, ghosted everyone including colleagues and friends.
>pathetic NEET for 3 years, had anxiety attacks whenever I thought about getting a job.
>Got a job at the start of this year as software dev in an outdated small company with mainly old cobol devs.
>Boss is a friend of my parents, typical boomer who doesn't understand anything of their company.
>Working in "new programming languages", web based projects. Only 2 other colleagues in this, one of them is leaving. Pay is terrible, borderline illegal.
>On my first week, those two guys spend a week getting their code in order before the one leaves. Never used git or any kind of version management. Jesus Christ.
>Little to no experience but I adapt very fast and start getting results. Organize all the projects, setup repos. Solo dev a new project. Boss impressed.
>In the close future, I might have the opportunity of joining a very big tech company from another of my parent's contacts.
>I know, nepo much.

So, considering the current state of software development jobs and AI. If given the option, should I apply to a position in my masters area, or keep going on with my career in software development.
>>
>>109098538
How the state of AI and see is related to this choice though? Anons above you literally just said that if AI is that good that you'll literally end up jobless, it means that lots of other jobs will be affected as well
>>
>>109098568
You might be right, I was under impressing AI usage was way more prominent in this field but I'm probably wrong. Still, any thoughts on the way forward?
>>
going to costco and seeing just how many subhumans exist makes you homicidal
>>
>>109098614
EE will be fucked, because if swe will be automated, guess where all the unemployed autists will go to?
>>
Yes, software engineers are getting cut down. But "consultants", "analysts", etc are totally, utterly useless in 2026. ChatGPT on High is absolutely better at giving you an answer than some midwit roastie from Shart Tech.
>>
>>109098679
>where all the unemployed autists will go to?
mass graves
>>
These are the new worker classes in the post AI age

>135+ IQ geniuses: the innovators, the top 2% who continue to push novel boundaries in things that is not yet synthesized in the AI model, but eventually will be.
>110-135 IQ operators: generalists who will leverage AI to do all the tasks business needs them to, merely executing the human side of it.
>90-110 IQ: firmly manual labor and blue collar coded
>under 90 IQ: headed for the sterilization camps
>>
>>109098718

Really in all of this the biggest losers are midwits because their brains are now more useful in the fields than in the office, it's totally over. Get ready for a new era of competitiveness for a small amount of generalist AI operator seats.
>>
>>109098718
>>109098724
holy clueless retards
>>
>>109098718
>>under 90 IQ: headed for the sterilization camps
that's racist anon, why would you sterilize all the blacks?
>>
>>109098696
Consultants have always been useless. The point of getting consultants isn't to get anything done, it's to shift blame when a doomed project fails.
>>
File: IMG_6848.jpg (1.19 MB, 1248x1872)
1.19 MB JPG
>got called in to interview for another job that clearly doesn't exist (or they have an internal candidate)
>>
>>109098007
At least as far as C++ goes the latest GPT is just as bad as GPT3.5, it just has tool calling and more context.
>>
>>109098940
It's useless to say these things to the ai psychosed. They are typically nocoders so they couldn't understand anyway.
>>
>>109096427
use the [.code] tags nigga
>>
File: 1777318645484594.png (70 KB, 1192x386)
70 KB PNG
>>
>>109096427
doing list[int] without importing is the modern way to define the type
>>
File: HK4G2oJWgAEhTQF.jpg (235 KB, 1162x2048)
235 KB JPG
>>109096427
wrong, you didn't indent.
>>
>>109098718
you forgot the failed CS grads data labelers and annotators which are the 100-110 IQ range.
>>
>>109096281
>>109096284
>>109096284
god i love tech-working
>>
>>109098718
>135+ IQ geniuses: expected to just grind it 60+ hours a week for no raise
>110-135 operators: told that if they were 135+ IQ geniuses then they would get a raise but its a lie
>90-110 IQ: marketing, sales, and executives who want to be in charge but keep making stupid decisions that cause their company to fail
>under 90 IQ: don't work. get free shit. have at least 3 kids and 2 baby mommas. bitch about how they don't get enough free shit to live the good life.
>>
>>109098538
>no career
>asking for career advice
>>
I'm unemployable. How do I become employable?
>>
>>109100217
Amazingly accurate, didn't expect this on nu/g/
>>
>>109096727
I make 200k and I'm married and I love my wife but hate my job. But I can't quit my job because my wife likes buying clothes and having a nice house. When I met her I was literally homeless because I didn't want to pay rent, I was living in university
>>
>>109100506
lmao if this was my life I would kill myself
>>
>>109100532
yeah when I'm too busy to see her I get suicidal the only thing I like is seeing her happy she is really cute. I'm only 25 but I can't do it anymore I'm hoping to escape the wage slaving by getting rich enough starting my own company. I don't really like engineering but it's the only thing I'm good at. Might bag the first major (250k) contract for my company later this year. Maybe if I scale it to ten contracts I can pull out and retire wish me luck
>>
>you defeat 98% of players
wow i'm so good at block blast!!!!
>>
>>109100581
You need to find something to actually do with your life, as it stands right now you're one divorce away from a suicide
>>
File: 1729066120372341.jpg (146 KB, 1024x679)
146 KB JPG
>>109100738
He's the kind of guy to have 3 kids with a woman who only loves disney and whoring herself out at 10am to other men before he catches on. Then she divorces him, takes full custody and marries a criminal then blames him for everything. All the while he lives at his parents house since his state has zero limits on Alimony payments or Child support. All the while he wonders if these are even his kids by the way they act/look and mannerisms(court ordered child visit for 24 hour period once every 6 months btw).
>>
File: 1759269439978746.gif (2.11 MB, 498x498)
2.11 MB GIF
>>109096281
>>109096284
>>109096299
>>109099364
will tech work or leetcode get me one of those things in your pictures?
>>
>>109100812
this is weird anon, I have issues but cuck fantasies are not one of them. No I do plan on raising my kids with my family. And my wife doesn't watch Disney or whatever, she hangs out at the community center tied to the church with her mother most days I'm working. Or shops, also with her mom. Yeah she doesn't do much besides housework, gossip and fashion but that's the point of women. If she had to do what I do she's be as ugly and grumpy as I am.
>>109100738
probably, I don't think I'd kill myself, I'd probably just leave all my money to my family and go camp out in the woods like I used to
>>
>>109100225
Thank anon, that was the only time I've ever opened up to other people
>>
>>109098679
EE will not be fucked because 99% of SWE are shit for brains code monkeys who can't math.

CompE is also not fucked because 99% of SWE are shit for brain code monkeys who think that anything with less than 4 gigabytes of RAM is a microcontroller and faint at the sight of a GOTO.
>>
can i get fired for this? im a summer intern and i wanted to use my claudecode account to test out some of the scripts i made at work, so i tried emailing my code in a zip file to my personal gmail so that i could download it to my pc but then i got a big red IT warning on my work laptop. apparently i committed data exfiltration and can get fired for this. is it over for me?
>>
>>109101987
yeah
>>
>>109101936
wow dude you're really smart I can tell by your post
>>
File: 1752490570573546.png (362 KB, 564x382)
362 KB PNG
hows the weekend going?
>>
>>109102002
I have a 3 digit IQ, do you?
>>
>>109102091
i got really drunk and now i dont feel so good
>>
https://x.com/slinkout/status/2068327868577268120
>>
>>109096592
> mfw "it shows green" is my entire troubleshooting skillset

welcome to the club, anon. nobody knows how half this shit works, we just keep the lights on and blame the vendor.
>>
>>109096782
>mfw the guy who can't reverse a linked list is my senior dev
>>
>>109100217
pretty much except the 90-110 IQ marketing/sales/executives fags are in fact in charge and destroying company after company because the goal of software nowadays is maxing your shareholder value by squeezing every ounce out of your customers and the people who actually make the software and not making products that people enjoy or even want to use
>>
File: 1779635815140103.jpg (589 KB, 1206x1719)
589 KB JPG
>>109102002
you would be surprised how effectively basic engineering mathematics filters out the dumbasses that dont use solution manuals and previous years' tests. jeets, looking at you
>>
>>109098966
>>109098940
opus generates C++ just fine for me

>>109101987
yeah your company owns everything, depends on how serious they are about IT how hard it will be to do data exfiltration. My last two companies don't care if I clone their private code on my personal computer. First one had a dedicated IT guy who would automatically uninstall programs from my computer if he didn't like their name.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.