A warmup day, a recovering day...
I did a lot of binary/bits problems in college, so this section really wasn't that bad. I sort of enojoyed it. Would love to have one of these during an interview.
- I took a long long break. Ran into a wisdom teeth extraction, and a capital one summit summer program. so... yk. some time off from leetcode. First day back today tho!!!
- Didn't do horrible, but could've been better. I feel as if my brain has remembered how to reason through problems.
- I did some bit stuff. SOme things I learned is that xor returns 1 if there is exactly 1 in the two things being xored.
- masking is not as simple as you thought. you can't just (mask & a) you have to check if that value is 0 or not, because (mask & a) could be 010000 which is like 216
- so the correct way is (mask & a) != 0.
- I did the math problem correctly, but python was really weird about negative numbers, so I think my solution was correct. Not the best. but It worked and the language had some fault.
- A lot of bit stuff is pattern recognition and I failed at that today. It's ok, I saw myself getting better tho. Bit stuff is not my strength, but I'm going to make it my bitch.
No comments:
Post a Comment