Recent posts

Maximum Average Subarray of Length k
AskAI Algorithms, Data Structures and Coding

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.

154
Dec 03
Two sum problem: Given an array of integers, return indices of the two...
AskAI Algorithms, Data Structures and Coding

The "two sum problem" is a classic problem in computer science that involves finding two numbers in an array that add up to a given target. This problem can be solved using a simple brute -force approach, but more efficient solutions exist, such as using a hash table.

111
Dec 02
Find the Shortest Path Between Any Two Words in a List
AskAI Algorithms, Data Structures and Coding

This problem asks us to find the shortest path between any two words in a list. For example, given the list ["cat", "bat", "rat"], the shortest path would be " cat" -> "bat" -> "rat".

160
Dec 02
Binary search for target in list of integers
AskAI Algorithms, Data Structures and Coding

Given a list of integers, write a function that returns the index of the first integer that is greater than or equal to the given target. If there is no such integer, return -1 .

179
Dec 02
Find all words in a 2D array of characters
AskAI Algorithms, Data Structures and Coding

This problem asks us to find all the words in a 2D array of characters. The input is a 2D array of characters, and the output is a list of strings containing all the words in the array.

158
Dec 02
Find a Number in a List
AskAI Algorithms, Data Structures and Coding

Given a list of numbers, the function will return the index of the number if it exists in the list. If it does not exist, the function will return -1.

118
Dec 02
Longest consecutive element sequence in an unsorted array
AskAI Algorithms, Data Structures and Coding

Given an unsorted array, this algorithm finds the length of the longest consecutive elements sequence.

155
Dec 02
Longest path of consecutive integers in a 2D array
AskAI Algorithms, Data Structures and Coding

Given a 2D array of integers, find the length of the longest path of consecutive integers. The path can move up, down, left, or right, but cannot skip over any numbers .

158
Dec 02