NeetCode Comprehensive Algorithm Bank & Offline Handbook
Synchronized bilingual toggle with dual NeetCode & LeetCode problem numbering and direct links. Features step-by-step logic, benchmark Python3 code, complexity analysis, interview pitfalls, and standalone offline exports.
Convert Object to JSON String (将对象转换为 JSON 字符串)
Implement jsonStringify(object), converting any serialisable value (object, array, string, number, boolean, null) into a JSON stri...
Array of Objects to Matrix (将对象数组转换为矩阵)
Given an array of nested objects arr, return a matrix whose first row lists all leaf-key paths (dot-joined, sorted lexicographical...
Differences Between Two Objects (两个对象之间的差异)
Given two objects obj1 and obj2, return their differences: a key present in only one object maps to [value, undefined] or [undefin...
Chunk Array (分块数组)
Given an array arr and a chunk size size, split the array into consecutive subarrays of length size, with the final chunk possibly...
Flatten Deeply Nested Array (扁平化嵌套数组)
Given a multi-level nested array arr and a depth n, return a new array flattened to depth n. The depth counts nesting levels, so n...
Array Prototype Last (数组原型上的最后一个元素)
Implement Array.prototype.last(): return the last element of the array, or -1 if the array is empty.
Group By (分组)
Implement Array.prototype.groupBy(fn): group the elements by the value returned by fn(element) and return a plain object whose key...
Check if Object Instance of Class (检查是否是类的对象实例)
Implement checkIfInstanceOf(obj, classFunction), which determines whether obj is an instance of classFunction by walking the proto...
Call Function with Custom Context (使用自定义上下文调用函数)
Implement Function.prototype.callPolyfill(context, ...args): invoke the function with context bound as this, passing args, and ret...
Event Emitter (事件发射器)
Implement an EventEmitter class: subscribe(eventName, callback) registers a callback and returns an object with an unsubscribe() m...
Array Wrapper (数组包装器)
Implement an ArrayWrapper class wrapping an integer array. Adding two instances with + returns the sum of all their elements, and ...
Generate Fibonacci Sequence (生成斐波那契数列)
Implement the generator function fibGenerator(), which yields the Fibonacci sequence 0, 1, 1, 2, 3, 5, 8, ... one value per next()...
Nested Array Generator (嵌套数组生成器)
Implement the generator function inorderTraversal(arr), which yields every integer of a multi-level nested array in pre-order.