[Easy] Find the element that appears once in sorted array
Given a sorted array of integers, every element appears twice except for one. Find that single one in linear time complexity and without using extra memory.
More …Given a sorted array of integers, every element appears twice except for one. Find that single one in linear time complexity and without using extra memory.
More …Given a string s consisting of lowercase Latin Letters, find the first non repeating character in s.
More …Given two unsorted arrays A, B. They can contain duplicates. For each element in A , count elements less than or equal to it in array B .
More …Given two unsorted arrays A[] of size n and B[] of size m of distinct elements, the task is to find all pairs from both arrays whose sum is equal to x.
More …Given an array A[0 … n-1] containing n positive integers, a subarray A[i … j] is bitonic if there is a k with i < k < j such that A[i] < A[i + 1] … < A[k] > A[k + 1] > .. A[j – 1] > A[j]. Write a program that returns the length of the maximum length bitonic subarray.
More …Given a number N, count the numbers from 1 to N which comprise of digits, only in set 1, 2, 3, 4 and 5.
More …Given a sorted array, rearrange the array alternately i.e first element should be max value, second min value, third second max, fourth second min and so on. Eg: arr[] = {1, 2, 3, 4, 5, 6, 7} O/P: {7, 1, 6, 2, 5, 3, 4}
More …You are given an array of integers representing coordinates of obstacles situated on a straight line.
More …Given an unsorted array of N integers which can contain integers from 1 to N. Some elements can be repeated multiple times and some other elements can be absent from the array. Count frequency of all elements from 1 to N.
More …An IP address is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. There are two versions of the Internet protocol, and thus two versions of addresses. One of them is the IPv4 address.
More …Given an array of integers, find the maximal absolute difference between any two of its adjacent elements.
More …Call two arms equally strong if the heaviest weights they each are able to lift are equal.
More …Given a string, find out if its characters can be rearranged to form a palindrome.
More …You are given an array of integers. On each move you are allowed to increase exactly one of its element by one. Find the minimal number of moves required to obtain a strictly increasing sequence from the input.
More …Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays.
More …