Cognizant Interview Question

OOPS, SQL, coding question based on arrays and strings