← Paytm questions

Longest line of 1s and Number of Islands

Filed under Paytm

Given a 2D binary matrix, find the maximum number of consecutive 1s forming a horizontal or vertical line, and count the total number of islands (groups of connected 1s horizontally and vertically).

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 Paytm questions

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