4 ms·
Is it useful in solving leetcode problems ?
by revskill 2y ago
Is it useful in solving leetcode problems ?
- noelwelsh 2y agoDynamic programming is often (always?) structured as a monoid, and that's the kind of thing that shows up in leetcode.
- sullyj3 2y agoCan you elaborate or point to resources?
- noelwelsh 2y agoI did a quick search and found this: https://aclanthology.org/C08-5001.pdf https://aclanthology.org/C08-5001.pdf Also good was section 4 of https://par.nsf.gov/servlets/purl/10237543 https://par.nsf.gov/servlets/purl/10237543 Both work with semirings, which are a structure with two monoids. I found these papers fairly readable on a quick skim, but I have a background in closely related stuff. They might not be so readable if you're not used to the style of presentation.
- whateveracct 2y agoyears ago, i solved plenty of HackerRank problems in Haskell with code that contained "instance Monoid ... where" :)