Panda Guru LogoPanda
Guru

🔥 Gym Challenge: How Fast Can You Get Tired? 🔥

Round 1

Questions: You must perform exercises until your energy drops to 0 or below.
Find the minimum number of exercises needed to reach exhaustion.
If it’s impossible to get tired even after performing every exercise twice, return -1.

Example 1:
Input:
E = 6
N = 2
A = [2, 3]
Steps:
Perform Exercise 1 (2 energy) → Remaining: E = 4
Perform Exercise 2 (3 energy) → Remaining: E = 1
Perform Exercise 1 again (2 energy) → E = -1 (Tired!)
Output:
3 (Total exercises performed)

Example 2:
Input:
E = 10
N = 2
A = [3, 1]
Steps:
Max energy drain possible (3+3 + 1+1) = 8
Still left with 2 energy! Can’t get tired!
Output:
-1 (You’re too strong!)

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.