1

Did 2 leetcode today (technically 1)

https://leetcode.com/problems/...

idea:
* Palindrome means cut it half, rearrange the other half, will equal each other.
* Using javascript new map() to build a hash map
* Loop the hash, add up quotient*2, add up remainder.
* if remainder > 1, then return_sum+1

https://leetcode.com/problems/...
seen a few times in interview.

* do the big one first, i.e. if(n % (3*5) === 0)
* then n%3 === 0
* then n%5 === 0

Comments
Add Comment