Google Phone screen

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-26Added By Anonymous
Source: Link
🧭 Experience: unknown ✅ Outcome: unknown 💰 Compensation: unknown 📍 Location: unknown 🏢 Company: Google 🎓 Education: unknown 🎁 Benefits: unknown 📅 Offer Date: unknown write a function to check given input string is balanced or not. input string will contain paranthesis and digits. whenever digit is occurred you need to remove digit number left side paranathesis in any order (ex: if digit is 2 you need to remove 2 paranthesis from left side means if inp == )(1, either I can remove ( or ) left side of 1). string is balanced if opening paranthesis is equal to closing (ex: (()), ()(), ()), treat each digit seperately if 11 is present in input treat them as 2 ones. ex: inp = (()1(1)) --> True inp = )1() --> True inp = )(1)) --> False
Comments