Loading...
Every submission is compiled and run inside an isolated sandbox on our own judge image. This page lists the exact toolchain behind each language, the flags it is built with, what is already imported for you, and which libraries ship alongside the standard library. The set mirrors LeetCode's environments, so a solution written there runs here unchanged.
Every problem declares one time limit and one memory limit, written for C++. Each language multiplies them by a fixed factor so that an interpreted solution is judged against a budget it can meet. The time limit applies to each test case on its own; the memory limit is the peak for the whole run and is capped at 500 MB in every language.
| Language | Time factor | Memory factor | On a 2 s / 256 MB problem |
|---|---|---|---|
| Python | 5× | 2× | 10 s / 500 MB |
| JavaScript | 5× | 2× | 10 s / 500 MB |
| Java | 3× | 2× | 6 s / 500 MB |
| C++ | 1× | 1× | 2 s / 256 MB |
| C# | 3× | 2× | 6 s / 500 MB |
| Go | 2× | 1× | 4 s / 256 MB |
| Rust | 1.5× | 1× | 3 s / 256 MB |
| Swift | 2× | 2× | 4 s / 500 MB |
Solutions run under CPython 3.14.7. The whole standard library is available, and the modules interview code reaches for most are imported for you, so a solution can use collections, itertools, heapq, bisect and friends without an import line.
The recursion limit is raised to 550,000 frames and the process stack to 128 MB, so a recursive depth-first search over a 10⁵-node tree does not need an explicit iterative rewrite.
typing (everything)collections (module and *)itertools (module and *)functools (module and *)heapq (module and *)bisect_left, bisect_right, insort, insort_left, insort_rightmath (module) plus inf, gcd, lcm, sqrt, isqrt, floor, ceil, log, log2, log10, comb, perm, factorial, prodstring (module) plus ascii_lowercase, ascii_uppercase, ascii_letters, digitsoperator (module) plus itemgetter, attrgetterre, random, copy (module) plus deepcopydataclass, field, Enum| Package | Version | Provides | Access |
|---|---|---|---|
| sortedcontainers | 2.4.0 | SortedList, SortedDict, SortedSet | already in scope |
Solutions run under Node.js 24.20.0 LTS, with every modern JavaScript feature the V8 engine of that release supports: optional chaining, nullish coalescing, private class fields, top-level BigInt, Array.prototype.at, structuredClone, and the rest.
The call stack is raised, so deep recursion works the way it does in the other languages instead of throwing "Maximum call stack size exceeded" at a few thousand frames.
| Package | Version | Provides | Access |
|---|---|---|---|
| lodash | 4.17.21 | _ | already in scope |
| @datastructures-js/priority-queue | 6.3.5 | PriorityQueue, MinPriorityQueue, MaxPriorityQueue | already in scope |
| @datastructures-js/heap | 4.3.7 | Heap, MinHeap, MaxHeap | already in scope |
| @datastructures-js/queue | 4.3.0 | Queue | already in scope |
| @datastructures-js/deque | 1.0.8 | Deque | already in scope |
| @datastructures-js/stack | 3.1.6 | Stack | already in scope |
| @datastructures-js/linked-list | 6.1.4 | LinkedList, LinkedListNode, DoublyLinkedList, DoublyLinkedListNode | already in scope |
| @datastructures-js/set | 4.2.2 | EnhancedSet | already in scope |
| @datastructures-js/binary-search-tree | 5.4.0 | require('@datastructures-js/binary-search-tree') | import it yourself |
| @datastructures-js/graph | 5.3.1 | require('@datastructures-js/graph') | import it yourself |
| @datastructures-js/trie | 4.2.3 | require('@datastructures-js/trie') | import it yourself |
Solutions are compiled with javac 25 and run on the HotSpot JVM from Eclipse Temurin 25.0.4.1 LTS. Records, sealed types, pattern matching for switch, text blocks, var, Stream.toList() and virtual threads are all available.
The commonly used packages are imported for you, and a javafx.util.Pair-compatible Pair<K, V> class (getKey, getValue, equals, hashCode) is defined in scope, as on LeetCode.
java.util.*java.util.concurrent.*java.util.concurrent.atomic.*java.util.function.*java.util.regex.*java.util.stream.*java.math.*java.io.*Pair<K, V>Solutions are compiled with g++ 14.4.0 using the GNU dialect of the C++23 standard and libstdc++ from the same release. Code is compiled with level-two optimization (-O2), and <bits/stdc++.h> is included for you through a precompiled header, so every standard header is already in scope.
GNU extensions are available as on most judges: __int128, __builtin_popcount and friends, variable-length arrays, and the policy-based data structures in __gnu_pbds (ordered sets and hash tables).
Ranges, std::span, <format>, <bit>, <numbers>, concepts and the three-way comparison operator all work. Range formatting (std::format("{}", vector)) is a GCC 15 feature and is not available.
<bits/stdc++.h>Solutions are compiled by the Roslyn compiler from the .NET 10 SDK (10.0.400) with C# language version 14, optimizations on and nullable reference types disabled, then run on the .NET 10 runtime. The full .NET 10 base class library is available, including PriorityQueue<TElement, TPriority>, System.Numerics.BitOperations, spans, and LINQ.
The most common namespaces are imported for you; anything else needs its own using directive at the top of the solution.
SystemSystem.CollectionsSystem.Collections.GenericSystem.DiagnosticsSystem.GlobalizationSystem.LinqSystem.TextSolutions are built with Go 1.27.0, so generics, min, max, clear, range-over-int and the slices, maps and cmp packages all work.
Write import blocks exactly as you would in a normal Go file. The harness lifts your imports into its own file header and merges them with the ones it already needs, so a duplicate import of fmt or sort is never an error.
bufio, bytes, fmt, oscontainer/heap, container/listencoding/hex, encoding/jsonmath, math/big, math/bits, math/randregexp, strconv, strings, unicode, timesort, slices, maps, cmpruntime/debug| Package | Version | Provides | Access |
|---|---|---|---|
| github.com/emirpasic/gods | v1.18.1 | github.com/emirpasic/gods/… | import it yourself |
| github.com/emirpasic/gods/v2 | v2.0.0-alpha | github.com/emirpasic/gods/v2/… | import it yourself |
Solutions are compiled with rustc 1.98.0 using the 2024 edition with optimizations on. Templates follow the LeetCode shape — an impl Solution block with associated functions — and the harness declares struct Solution; for you unless your code defines it.
The three crates LeetCode ships are available with an ordinary use line; nothing else is on the crate path.
std::rc::Rcstd::cell::RefCell| Package | Version | Provides | Access |
|---|---|---|---|
| rand | 0.8.8 | use rand::… | import it yourself |
| regex | 1.13.1 | use regex::… | import it yourself |
| itertools | 0.14.0 | use itertools::… | import it yourself |
Solutions are compiled with swiftc 6.2.4 with optimizations on. Foundation is imported, and the three Apple packages LeetCode ships are imported for you as well.
Templates use class Solution with underscore argument labels (func twoSum(_ nums: [Int], _ target: Int)), matching LeetCode Swift.
FoundationCollectionsAlgorithmsNumerics| Package | Version | Provides | Access |
|---|---|---|---|
| swift-collections | 1.6.0 | Deque, Heap, OrderedSet, OrderedDictionary, BitSet, TreeSet, … | already in scope |
| swift-algorithms | 1.2.1 | combinations, permutations, chunks, windows, … | already in scope |
| swift-numerics | 1.1.0 | Real, Complex, … | already in scope |