Algorithms

First non-repeating character in a string.
AskAI

Given a string, find the first non-repeating character.

Array Sum
AskAI

This technical problem involves finding the sum of all elements in an array. For example, given the array [1, 2, 3, 4], the sum would be 10.

Sum of all odd numbers in an array
AskAI

The function should take in an array of integers and return the sum of all the odd numbers in the array. In the example given, the output would be 9.

Find the Largest Sum in a Contiguous Subarray
AskAI

The problem asks for the largest sum of a contiguous subarray in an array of integers.

Group Anagrams
AskAI

This problem asks you to group all the anagrams in an array together. Anagrams are strings made up of the same letters, but in a different order. For example, " abcd" and "dcba" are anagrams, but "abcd" and "efgh" are not.

Determining If Two Strings Are Permutations Of One Another
AskAI

This problem asks whether two strings are permutations of one another. A permutation is defined as a rearrangement of the elements of an ordered list. This means that, for the two strings to be permutations of one another, they must have the same characters in the same order. In the given example, string1 is a permutation of string2 because both strings have the characters 'a', 'b', and 'c' in the same order.

Find the Longest Subarray with Consecutive Integers
AskAI

Given an array of distinct integers, the goal is to find the length of the longest subarray with consecutive integers. For example, given the array [5, 2, 7, 1, 3, 8, 4, 9], the longest subarray with consecutive integers is [2, 7, 1, 3, 8], so the output would be 5.

Largest sum of non-adjacent elements in an array
AskAI

The largest sum of non-adjacent elements in an array can be found by using a function. The input is an array of integers and the output is the largest sum of non-adj acent elements in the array.