Sumo Logic Interview Question

Two leetcode easy style questions