[LeetCode] (463) Island Perimeter

Basic Idea: for each cell, add the number of legal sides to the solution.

Time Complexity is .

[LeetCode] (459) Repeated Substring Pattern

Basic Idea: try to obtain the original string using all possible repeated substring from the shortest to the longest.

Time Complexity is

[LeetCode] (455) Assign Cookies

Basic idea: using a greedy algorithm, prioritize satisfying kids with lower greed and assign cookies this way as many as possible. Implementation Apple:

Time Complexity is .   Implementation

Load More Posts