2018-05-16

LeetCode

593 Valid Square

This is a pure math problem.

110 Balanced Binary Tree

I used recursion to solve this.

791 Custom Sort String

C# String Class

  • to construct a string from char array: String s = new String(chars);
  • to access character by index: char c0 = s[0]
  • to convert a string to char array: s.ToCharArray()
415 Add Strings
  • convert char to integer: (int) (c - '0')
  • convert integer 0-9 to char: (char) ((int) '0' + i)
TODO 93 Restore IP Address
  • IP Address format: 32-bits, 0 - 255 for each number.

你可能感兴趣的:(2018-05-16)