Reverse Bits of a given Integer

Given an integer, reverse its bits using binary operators.     The idea is to initialize the result by 0 (all bits 0) and process the given number starting from its least significant bit. If the current bit is 1, then we set the corresponding most significant bit in the result and finally move on …

Add elements of two arrays into a new array

Given two arrays of positive integers, add their elements into a new array. The solution should add elements of both arrays one by one starting from 0’th index and split the sum into individual digits if it’s a two-digit number.

Guava’s Chars Class in Java for primitive char array

Guava package provides utility classes for all primitives types such as Chars, Longs, Ints, Doubles, etc. In this article, we will talk about Guava Chars class which provides static utility methods to work with primitive char array.