Software Development Interview Questions

37,019 software development interview questions shared by candidates

Write a function solution that, given a string S consisting of N characters, returns the maximum number of letters 'a' that can be inserted into S (including at the front and end of S) so that the resulting string doesn't contain three consecutive letters If string S already contains the substring "aaa", then your function should return -1 .
avatar

SDE-intern

Interviewed at OpenText

3.2
Apr 12, 2023

Write a function solution that, given a string S consisting of N characters, returns the maximum number of letters 'a' that can be inserted into S (including at the front and end of S) so that the resulting string doesn't contain three consecutive letters If string S already contains the substring "aaa", then your function should return -1 .

Viewing 2761 - 2770 interview questions

Glassdoor has 37,019 interview questions and reports from Software development interviews. Prepare for your interview. Get hired. Love your job.