← Flipkart questions

Count substrings starting and ending with 1

Filed under Flipkart · Also reported at JPMorgan Chase

Given a binary string s containing only '0's and '1's, count the number of substrings that start and end with '1'.

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

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