← Swiggy questions
CodingReported in a candidate post, Jan 2021

Travelling salesman using a greedy approach

Filed under Swiggy

Given n cities and a matrix of pairwise distances, find a route that starts at city 0, visits every city exactly once and returns to city 0, using a greedy method (always go to the nearest unvisited…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Swiggy questions

Collected from public candidate posts and coding forums. Updated Nov 2026.