Photo of a teacher following the Common Sense Education Instagram account and smiling

Follow our Instagram account for educators!

Keep up with the latest media and tech trends, and all of our free resources for teachers!

Tcs — Coding Questions 2021 ((free))

def max_subarray_sum(arr): max_sum = float('-inf') current_sum = 0

Example: Input - [1, 2, 3, 4, 5], target sum - 7, Output - 2 Tcs Coding Questions 2021

Example: Input - "aabbc", Output - "c"