Ruby regex solution, 2 lines


  • 0
    S
    def is_one_bit_character(bits)
      b_str = bits.join.gsub /10|11/, '2'
      b_str[-1] == '0'
    end
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.