LEGRAND Hiring | Campus Interview Question | On-Campus OA (2025)

Question · Posted Jun 2026

Problem Statement Given a string s containing only 'a' and 'b', return true if every 'a' appears before every 'b'; otherwise return false. Example Input s = "aabbb" Output true Constraints 1 <= s.length <= 100

The full answer & interview discussion are available to premium members.

Log in Create a free account