← Walmart questions

Substring count from rearranged string

Filed under Walmart

Given two strings s1 and s2, count how many times s2 can be formed using the characters of s1. Since s1 can be rearranged, character order in s1 does not matter.

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

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