Projects Dead Ops Prime Edition(D.O.P.E). LINK: https://goo.gl/e3iCjc Worked on Blood spill particle effect, mesh destruction, bullet trail. Tech: C++, Unity … Continue reading Portfolio
Vivaldi is insanely good, very lightweight except video and gif is not working lately…. Turns out they disable hardware acceleration … Continue reading Back to Vivaldi
Today Leetcode problem is rotating linked list . Doing it is a no brainer( Answer below). What I suddenly realize is you could pipe the boolean expression to simplify the boolean check later on. To jump straight on:
int k1 = (l == 0 ) ? 0 : k % l; /* equivalent to if(l != 0 ) k1 = k % l; else k1 = 0; */ if(k1 == 0) return head; //rotate with k multiple of list length or list empty
It is like a filter so the end result is just one simple check. I know it won’t make much of a difference but it comes to my mind naturally.
Was browsing through Medium coding problems of Leetcode( Oh yeah. I think Im at this level ) when I stumble upon this one — validating binary tree. Pfft. You dummy, NO WAY this is medium. Turns out it is harder than I thought ^^, not because it is hard but because of my stupid mistakes….