Skip to content

Instantly share code, notes, and snippets.

View googleknight's full-sized avatar
🏠
Working from home

Shubham Mathur googleknight

🏠
Working from home
View GitHub Profile
@googleknight
googleknight / cambAI.js
Created October 8, 2025 14:47
GigaArray implementation
class GigaArray extends Array {
constructor(servers) {
super();
this.length = 0;
this.servers = servers;
this.availableServerIndex = 0;
}
// internal private function
#getServerAndIndex(index) {
const serverNumber = Math.floor(index / Server.capacity);