SAS interview question

Introduction Questions on my project Two DSA questions(level-medium)