Skip to content

genxium/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maximize/minimize "f(inputs)" by K times of using "operation(...)" on "inputs"

For the less difficult ones of these problems, they may have an "optimal substructure", e.g. "f(inputs)[k] = max{ operation(f(inputs)[j]) | j <= k-1 }", to exploit and we can just iterate K times to get the answer.

For the more difficult ones of these problems, they often don't have an "optimal substructure", or exploiting the "optimal substructure" isn't fast enough, hence demanding us to derive a "greedy step for current state".

For some peculiar ones where K is very small but neither an "optimal substructure" nor an obvious "greedy step for current state" is available, we can just search exhaustively.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages