Roblox Hackerrank OA

Hi all,

I recently gave Roblox’s OA

Question 1 – return the most recurring element in an array (easy)
Question 2 – find all possible substrings in a string that are palindrome (naive solution doesn’t work)
Question 3 – given an array of integers and a number (m) find all subarrays that have m number of even/odd elements

I was able to complete question 1 and 3; however, for question 2 I wasn’t able to pass 3 test cases as they were exceeding time limit

1 Like

Hi Daniyal,
Thank you for sharing. Regarding to the second question, I believe you can use algorithm to find length of longest substring in a string. A normal dp way would take O(n^2) and using manacher algo would be linear (but it is quite hard).