mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 11:21:00 +00:00
Docs: Update benchmark for google/gemini-3.1-pro-preview
This commit is contained in:
17
tests/2_convex_hull/outputs/google_gemini-3.1-pro-preview.js
Normal file
17
tests/2_convex_hull/outputs/google_gemini-3.1-pro-preview.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const findConvexHull = async p => {
|
||||
const { uniqWith, isEqual, sortBy } = await import('https://esm.sh/lodash-es');
|
||||
const s = sortBy(uniqWith(p, isEqual), ['x', 'y']);
|
||||
if (s.length < 3) return s;
|
||||
|
||||
const cw = (o, a, b) => (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x) <= 0;
|
||||
|
||||
const fn = a => a.reduce((h, pt) => {
|
||||
while (h.length > 1 && cw(h.at(-2), h.at(-1), pt)) h.pop();
|
||||
return h.push(pt), h;
|
||||
}, []);
|
||||
|
||||
return [...fn(s).slice(0, -1), ...fn([...s].reverse()).slice(0, -1)];
|
||||
};
|
||||
export default findConvexHull;
|
||||
// Generation time: 39.797s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user