LeetCode the second week of November topic summary


Open Source Address: Click on this link


Foreword

Busy recently, this week is almost no problem brush, just brush the six questions ~

Topic Summary

  • 0387_first_unique_character_in_a_string
    similar topics more, and the string to find out that a particular, due to the limited number of strings, so you can directly use the hash table, using unordered_map be a bit slow, the direct use of the array faster; The first time through statistics the number of each character, a second pass to find the first character can appear only once.
  • 0389_find_the_difference
    problem is to find out what the only two strings of a different character, this topic and 0268_missing_number similar, because the two strings is only one different, all other things the same, so the same can be offset by the XOR, the last remaining we are looking for that one up.
  • 0392_is_subsequence
    The questions were very simple, and interested look at the code on the line.
  • 0401_binary_watch
    The title is essentially a combination of problems, although the title with a combination of seemingly nothing - a total of 10 optional bits, then given a few bits can be 1, so that calculate all possible types of time, due to the choice which of the order is not concerned, it is not a full array, it is only possible to calculate all the combinations, and then converted to time.
  • 0404_sum_of_left_leaves
    typical recursive problems.
  • 0405_convert_a_number_to_hex
    number point to note is input may be negative, so as to operate directly on the negative endless loop, it first must be converted to a negative force unsigned number, then every 4 bits into a decimal number to 16 .

Guess you like

Origin www.cnblogs.com/jiau/p/11881166.html