Given a string, this problem returns the index of the first non-repeating character in the string. If there is no such character, the problem returns -1.
Given an array of n integers, this algorithm finds the contiguous subarray of given length k that has the maximum average value. The output is the maximum average value.
Given an array of integers, this algorithm finds the maximum sum of any contiguous subarray of the array. For example, given the input array [34, -50, 42, 14, -5, 86], the algorithm would output 137.
Given an array of integers, the function returns the sum of the odd numbers in the array.
This problem asks whether one string is a permutation of another. To check this, we can compare the two strings character by character. If they have the same characters in the same order, then one is a permutation of the other.
The function should take an array of integers as input and return the sum of the odd numbers in the array.