Tuesday, October 27, 2020

Flipping bits - Hacker Rank Solution

 You will be given a list of 32 bit unsigned integers. Flip all the bits ( and ) and print the result as an unsigned integer.

Maximum Xor - Hacker Rank Solution

 You are given an array  of  elements. A list of integers,  is given as an input, find the maximum value of  for all  , where  represents xor of two elements.

Friend Circle Queries - Hacker Rank Solution

 The population of HackerWorld is . Initially, none of the people are friends with each other. In order to start a friendship, two persons  and  have to shake hands, where . The friendship relation is transitive, that is if  and  shake hands with each other,  and friends of  become friends with  and friends of .

Time Complexity: Primality - Hacker Rank Solution

 A prime is a natural number greater than  that has no positive divisors other than  and itself. Given  integers, determine the primality of each integer and print whether it is Prime or Not prime on a new line.

Recursion: Fibonacci Numbers - Hacker Rank Solution

The Fibonacci Sequence

The Fibonacci sequence appears in nature all around us, in the arrangement of seeds in a sunflower and the spiral of a nautilus for example.

Sunday, April 5, 2020

Decibinary Numbers- Hacker Rank Solution

Decibinary Numbers- Hacker Rank Solution

Candies- Hacker Rank Solution

Candies- Hacker Rank Solution

Abbreviation- Hacker Rank Solution

Abbreviation- Hacker Rank Solution

Structuring the Document - Hacker Rank Solution

Structuring the Document - Hacker Rank Solution
The true problem here is to write function  from string. Let's write some assisting functions  and . They all will take some substring of the original string as a parameter. You can pass the substring itself, however, in order to save time and memory, two indices are recommended instead: the index of the original string where the substring begins and the index of the original string where the substring ends.
Powered by Blogger.