This problem asks for the sum of all elements in an array. An example input is given as [1, 2, 3, 4, 5], and the expected output is 15.

204

Feb 18
Given a string, this problem seeks to find the index of the first non-repeating character within it. If no such character exists, the function returns -1. Examples are provided to demonstrate how the function works.

187

Feb 18
Given an array of integers, the largest sum of any contiguous subarray can be found by iterating through the array and keeping track of the current sum. If the current sum is greater than the largest sum found so far, it becomes the new largest sum. The largest sum is then returned.

203

Feb 18
Given a string, the longest substring without repeating characters is found by iterating through the string and keeping track of the longest substring found so far.

210

Feb 18
Given an array of integers, this algorithm will find the first missing positive integer. It runs in linear time and constant space.

209

Feb 18
This problem asks the programmer to return the sum of the odd numbers in an array. An example input would be [1, 2, 3, 4, 5] and the corresponding output would be 9.

224

Feb 17
Given an array of n integers, find the contiguous subarray of given length k that has the maximum average value. Output the maximum average value.

198

Feb 17
Given an array of integers, this problem asks you to find the first missing positive integer. You should do this in linear time and constant space. Note that the array may contain duplicates and negative numbers.

229

Feb 17