ByteDance interview question

2 easy, 1 medium coding questions