[Easy] Next larger element

Given an array A [ ] having distinct elements, the task is to find the next greater element for each element of the array in order of their appearance in the array. If no such element exists, output -1

More …

[Easy] Equilibrium point

Given an array A your task is to tell at which position the equilibrium first occurs in the array. Equilibrium position in an array is a position such that the sum of elements below it is equal to the sum of elements after it.

More …

[Easy] Key Pair

Given an array A[] of n numbers and another number x, determine whether or not there exist two elements in A whose sum is exactly x.

More …

[Basic] Swap two nibbles in a byte

Given a byte, swap the two nibbles in it. For example 100 is be represented as 01100100 in a byte (or 8 bits). The two nibbles are (0110) and (0100). If we swap the two nibbles, we get 01000110 which is 70 in decimal.

More …