Task 1: "Words Length You are given a string $S with 3 or more words. Write a script to find the length of the string except the first and last words ignoring whitespace. Example 1: Input: $S = "The Weekly Challenge" Output: 6 Example 2: Input: $S = "The purpose of our lives is to be happy" Output: 23 ME: WRONG! length(purpose of our lives is to be)==29 My notes: simple, clearly defined: use the power of regexes. Task 2: "Flip Array You are given an array @A of positive numbers. Write a script to flip the sign of some members of the given array so that the sum of the all members is minimum non-negative. Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements of array should be minimum non-negative(as close to zero as possible). Return the minimum no. of elements whose sign needs to be flipped such that the resultant sum is minimum non-negative. Example 1: Input: @A = (3, 10, 8) Output: 1 Explanation: Flipping the sign of just one element 10 gives the result 1 i.e. (3) + (-10) + (8) = 1 Example 2: Input: @A = (12, 2, 10) Output: 1 Explanation: Flipping the sign of just one element 12 gives the result 0 i.e. (-12) + (2) + (10) = 0 My notes: clearly defined, but how to go about this one? several possible approaches. brute force: each element may either be negated or not; try all combinations:-) not very elegant, but does the job..