The Lab
Practice Swift DSA in a calm environment.
Minimal distractions, maximum signal. Solve interview-grade problems with a clean Swift editor and instant output.
Two Sum
Given an array of integers `nums` and an integer `target`, return indices of the two numbers such that they add up to `target`.
Hint: Use a Dictionary to store the complement of each number as you iterate through the array.
Solution.swift Tests.swift
Output
Ready to run.