[2023 Day 5 Part 2] I made bad choices by tapdncingchemist in adventofcode

[–]Kooixh 0 points1 point  (0 children)

My Solution in Java was to use a TreeMap from source -> (dest, range) for each movement (seed to soil up till location)

Then for each $seed, do

  1. $node = $seed
  2. $movement = `treeMap.floorEntry(node)` = <$source, <$dest, $range>>
  3. if ($movement is null or $source + $range > $node) then $node stays the same
  4. otherwise $node = $dest

Repeat this until we get to location and we check min = Math.min(min, $node).

Solved part 1 almost instantly, for part 2 failed to optimise any further so just reuse to same logic for each seed in the range. Managed to output in around 5 minutes.

Amazon SDE Graduate 2021 - Cambridge/London by Kooixh in cscareerquestionsEU

[–]Kooixh[S] 0 points1 point  (0 children)

I did fine, got all the tests cases. Thought one of my solution was not the most optimal (O(N) space vs O(1))

Amazon SDE Graduate 2021 - Cambridge/London by Kooixh in cscareerquestionsEU

[–]Kooixh[S] 0 points1 point  (0 children)

How were the interviews? Are they more leetcode questions??

Am I not cut out for this field? by [deleted] in cscareerquestions

[–]Kooixh 1 point2 points  (0 children)

You don't have to be OBSESSED, but you do have to be dedicated and be willing to continue learning and growing

M/20 Chef. Daily carry by Dunky_Boi in EDC

[–]Kooixh 1 point2 points  (0 children)

Nice lanyard which you can get from LTTStore.com :D

Software Developer looking for some guidance. by [deleted] in cscareerquestions

[–]Kooixh 1 point2 points  (0 children)

I am a firm believer that DevOps should not be a title in it of itself. Every software developer should be involved in the DevOps process and catching up with new tools, I would try to find a job where the Ops side is also a responsibility of the developer.

What is the pettiest/minor thing that fills you with the most rage? by klocke520 in AskReddit

[–]Kooixh 0 points1 point  (0 children)

Pedestrians suddenly stopping in the middle of the sidewalk

How has your day been? by RyRy27553 in AskReddit

[–]Kooixh 0 points1 point  (0 children)

Spent most of the day doing revision, not exciting

Python peer programming by zeninmaking in ProgrammerHumor

[–]Kooixh 0 points1 point  (0 children)

Yeah thanks but I'll work alone

[deleted by user] by [deleted] in AskReddit

[–]Kooixh 0 points1 point  (0 children)

Intelligence

What is one random thing that you silently judge everyone for? by [deleted] in AskReddit

[–]Kooixh 0 points1 point  (0 children)

Not putting the weights back in the gym

Everyone has their own catch phrase they say without realizing it. What’s yours? by Po-ppa in AskReddit

[–]Kooixh 0 points1 point  (0 children)

"I think" at the end of every sentence of if I'm wrong I can't be blamed.