/divide-and-conquer-leetcode

Divide and conquer all leetcode problems

Primary LanguageJavaMIT LicenseMIT

divide-and-conquer-leetcode

Divide and conquer all leetcode problems.

Introduction

Every one trys to learn various methods to solve leetcode problems. However, few people grasp the core of all algorithms and therefore most of us cannot solve novel problems we didn't seen before.

To overcome all these problems, I want to have a experiment on solving every leetcode problem with divide and conquer. If I can prove this, give me your star; If I fail, no regret.

Spirit

  • Use divide-and-conquer.
  • Ok if pass all leetcode tests.
  • Solutions should obey complexity (time and space) constraints of the problem (if any).

Setting

To be practical, I shall use Java, C++, Rust, Go and TypeScript (JavaScript as subset of TypeScript) for all experiments(may have Scala and Haskell some day).

The world has not been prepared for everything.

  • Java is terrible in the field of abstraction and expression.
  • C++ is terrible at clean abstraction and full of traps.
  • Go lacks generic method and full of traps.
  • TypeScript lacks Higher-kinded types.
  • Rust is fine but currently lacks mature ecosystem.

Strategies

Please refer to the strategy doc. I wrote a brief guide on divide-and-conquer all problems

Contribution

Welcome to your contribution! If you want to contribute, Please refer to The contribution guide.

Epilogue

Fuck leetcode, long live divide-and-conquer!