Rocky_Mountain_Vending/.pnpm-store/v10/files/e0/7fdcb6822f84fe712066425e11aef56413df0a9e2950604e18be8176d2634869ce9cae54a65124f44a6a567e043fcf48b5277cac1b11232a1f13ddfdef39a6
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

27 lines
518 B
Text

import appearance from "./appearance.js";
import {sum} from "./ascending.js";
export default function(series) {
var n = series.length,
i,
j,
sums = series.map(sum),
order = appearance(series),
top = 0,
bottom = 0,
tops = [],
bottoms = [];
for (i = 0; i < n; ++i) {
j = order[i];
if (top < bottom) {
top += sums[j];
tops.push(j);
} else {
bottom += sums[j];
bottoms.push(j);
}
}
return bottoms.reverse().concat(tops);
}