ServiceNow Interview Question

coding question, it was done via hackerrank