800. Similar RGB Color
For any given six digits hexadecimal number, return a closest shorthand convertible number (#AABBCC <-> #ABC)
. Example : #09f166
-> #11ee66
Solution
Considering a hexadecimal shorthand number #a
, the difference between #a
and #a±1
is (16+1)/2, so if there’s a number who’s difference with #a
is larger than 8, then it doesn’t belong to the shorthand. Based on this property, we can determine whether a 2 digit hexadecimal belongs to its first digit’s shorthand.
Status
Time Complexity : O(n)
801. Minimum Swaps To Make Sequences Increasing
Given two sequences, return the minimum number of swaps to make both sequences strictly increasing. It is guaranteed that the given input always makes it possible.
Solution
Status
Time Complexity : O(n)
802. Find Eventual Safe States
Solution
Status
Time Complexity : O(V+E)
803. Bricks Falling When Hit
Solution
Status
Time Complexity : O(N^2)