# Category: Array

## Minimum Absolute Difference in an Array

Given an array of integers, find and print the minimum absolute difference between any two elements in the array. For example, Input: -59 -36 -13 1 -53 -92 -2 -96 -54 75 Output: 1...

## Find the first unique character in a given string or an array

Problem You are given an a string of characters including duplicates. You need to find the first non-repeating / unique character. input: foobar output: f input: aabbccdef output: d input: aabbcc output: ‘No Unique...

## Loop over an array with the given timeout for each element

Problem You are given an array of objects each with its name and timeout value. Iterate over each element inside an array in the interval of the given timeout. Solution We have to set...

## increment an integer array by one

Problem Given an integer array, increment its numeric value by one. For example, increment([2, 7, 3]) returns [2, 7, 4] Solution

## Find target subtraction is possible in a given unsorted array of numbers

Problem statment Given an array of unsorted numbers and a target element. Find if any two elements subtract to the target element or not. You can loop through the array only once. Constraint: Time...

## Tic Tac Toe Winner

Interview Question Implement an algorithm that determines if someone has won a game of tic-tac-toe Algorithm To determine if any of the two players have won the TicTacToe game or not, We need to...

## Implement the function that determines whether you can or cannot seat a number of people in the row.

— Problem People are sitting in a theater row and you’re an usher. Given a row of seats that either occupied (1) or unoccupied (0) and the condition that new people being seated...

## Merge K-sorted Arrays

Problem : Given k sorted arrays of size n, merge all the k arrays into one sorted array. Example : var n_k_arr = [ [ 8, 10, 12 ], [ 6, 9, 13 ],...

## Given an array of numbers, return array of products of all other numbers

Problem Given an array of n integers, return an array of same size such that prod[i] is equal to the product of all the elements of arr[] except arr[i].   Restrictions  – Not allowed to...

## Find length of the largest subarray with contiguous elements

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” text_text_color=”#000000″ use_border_color=”off” border_color=”#ffffff” border_style=”solid”] Given an array of distinct integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence. If...