随笔分类 - Leetcode
Leetcode: Split BST
摘要:Note: The size of the BST will not exceed 50. The BST is always valid and each node's value is different. Note: The size of the BST will not exceed 50
阅读全文
Leetcode: Optimize Water Distribution in a Village && Summary: Union Find and Minimum Spanning Tree
只有注册用户登录后才能阅读该文。
Leetcode: Rotated Digits
摘要:X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotated - we cannot choose to leave it alone. A number i
阅读全文
Leetcode: Repeated String Match
摘要:The idea is to keep string builder and appending until the length A is greater or equal to B. use a while loop to keep adding A to stringBuilder until
阅读全文
Leetcode: Student Attendance Record I
摘要:1-liner s.contains("") normally is O(nm), but can be optimized to be O(n) O(n) scan
阅读全文
Leetcode: Robot Room Cleaner
摘要:Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move forward, turn left or turn right. Each turn it made is...
阅读全文
浙公网安备 33010602011771号