PHP

Daily Leetcode Solution

  • javascript
  • leetcode
  • software

54 comments

Caleb Akeju
8 hours ago

image

This solution follows a pattern. I consider it easy.

Caleb Akeju
9 hours ago

image

The challenging thing about this question is that you can do subtraction in roman numerals by placing a lesser number before a bigger one, so when you encounter such an arrangement you'd subtract the current from the whole res or you could just subtract current from the next and add it to the result. It's same thing. Otherwise, just add away. I folded the Romana Numeral/numbers hashtable to allow the solution be a single shot.

Caleb Akeju
9 hours ago

image

Turns out the way to check if all values in an array are thesame is to pick a random value and check against the whole array. In my case, I picked the first one.

Caleb Akeju
3 days ago

image

lol

Caleb Akeju
4 days ago

image

This question and solution eventually make sense after explanation from AI and writing it out repeatedly.

Load More...