Two Sum
Given an array and target, return two indices whose values add to the target.
Free trial preview
This public preview shows the shape of the course without exposing the paid course bundle. Create an account when you are ready, accept the terms, and checkout unlocks the full studio.
Given an array and target, return two indices whose values add to the target.
Scan once, keep the lowest buy price so far, and update the best profit.
Use a set to detect whether any value appears more than once.
Course preview
Full access opens the runnable DSA workspace, Python and Java labs, system and database prep, AI notebook lessons, cheatsheets, solution reveals, and progress tracking.
Variables, strings, functions, OOP, collections, and interview-style exercises.
Classes, collections, exceptions, streams, and hands-on coding checks.
Embeddings, vector search, RAG, LangChain, LangGraph, MCP, agents, and automation.