[LeetCode] Challenge log 669 Posted on 2018-04-26 | Edited on 2018-04-27 | 669. Trim a Binary Search TreeRecursive solution: Use the special property of binary search tree: left sons are smaller while right sons are greater. Read more »
[LeetCode] Challenge log 575 Posted on 2018-04-26 | Edited on 2018-04-27 | 575. Distribute CandiesSuper Straightforward. if candies kinds > half of total, output the latter; otherwise the former. Read more »
[LeetCode] Challenge log 682 Posted on 2018-04-26 | Edited on 2018-04-27 | 682. Baseball GameStraightforward O(n). Use two run and O(1) space. Can use a stack to reduce to one run — O(n) space. Read more »
[LeetCode] Challenge log 412 Posted on 2018-04-26 | Edited on 2018-04-27 | 412. Fizz BuzzIt isn’t really interesting. Read more »
[SQL] [LeetCode] Challenge log 620 Posted on 2018-04-25 | 620. Department Top Three SalariesUse SQL wildcard with like . % is any length. _ is one character. Read more »
[LeetCode] Challenge log 500 Posted on 2018-04-25 | 500. Keyboard RowUse dict to map charaters to row numbers. Read more »
[LeetCode] Challenge log 557 Posted on 2018-04-25 | 557. Reverse Words in a String IIISelf explained. Read more »
[LeetCode] Challenge log 476 Posted on 2018-04-20 | 476. Number Complement Use XOR 11111… to flip bit. Use Mask to decide which bits are 1s. Read more »
[LeetCode] Challenge log 806 Posted on 2018-04-19 | 806. Number of Lines To Write StringStraightforward. Python string <-> ascii: ord() chr() -> Read more »
[SQL] [LeetCode] Challenge log 627 Posted on 2018-04-19 | 627. Swap SalarySql if and case statement: update [table] set [column] = if ([condition], [v1], [v2] ) (see case example at the end) Read more »