Reverse Integer

Problem Statement “Reverse Integer” problem states that you are given an integer variable n containing the number to be reversed. Write a program to reverse its digits. Reversing an integer is nothing different from reversing a string. We can easily convert an integer into a string. And then use the …

Read more

Convert String To Int

Convert string to int, requires us to convert a numeric string given to an integer. Here we are assuming, we are provided with a numeric string without white spaces either in the middle of the characters or at any one of the ends. We are also assuming that the string …

Read more

Reverse Bits

Reverse bits of a given 32 bits unsigned integer. Example Input 43261596  (00000010100101000001111010011100) Output 964176192 (00111001011110000010100101000000) A 32-bit unsigned integer refers to a nonnegative number which can be represented with a string of 32 characters where each character can be either ‘0’ or ‘1’. Algorithm for i in range 0 …

Read more

Translate »