Add `mins` and `maxes` TypeScript goodies
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- tooling
Direzione di ricerca
Inizia individuando Iterator.prototype.min e Iterator.prototype.max, quindi leggi le utility BinaryHeap e compareNatural. Considera i nomi proposti Iterator.prototype.mins e Iterator.prototype.maxes e come verrebbe gestito il comparatore per ciascuno. Il lavoro è completato quando entrambe le utility proposte funzionano per più minimi o massimi; il comportamento di NaN può rimanere fuori dall'ambito iniziale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The Ruby min and max methods allow specifying an argument, to get more than one minimum or maximum. I think it'd be fun to add a goody for this, but rather than modifying Iterator.prototype.min and/or Iterator.prototype.max, I think we should have new goodies for this, since it's a somewhat niche need.
I'm proposing Iterator.prototype.mins and Iterator.prototype.maxes as the names for these, although other suggestions are welcome.
For the implementation, BinaryHeap would be fun to use. It will be easiest to start with .maxes (since the default behavior of the heap is as a min-heap, and we can use compareNatural goody as the default comparator). For .mins, it will be necessary to come up with a way to reverse the comparator.
Additional note: min and max handle NaN specially. We can skip that behavior to start with for .mins and .maxes, and come back to it later.
- Lingua principale
- TypeScript
- Stelle
- 20
- Fork
- 12
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di code-chronicles-code/leetcode-curriculum
-
enhancement kotlin
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
good first issue tests
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
Add tests for `swap` utility Apertagood first issue tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
good first issue tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
code-chronicles-code/leetcode-curriculum#418 · 1 commento ·
Tutte le issue di code-chronicles-code/leetcode-curriculum
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
TanStack/tanstack.com#1293 ·