saptarshisarkar20 / Novice-Coding

Helping everyone to code and creating pull requests
19 stars 34 forks source link

Write a Code [ Python, CPP, C, JAVA, JS ] to solve the Leetcode Problem #18

Closed saptarshisarkar20 closed 2 years ago

saptarshisarkar20 commented 3 years ago

Reverse Bits

Problem link : https://leetcode.com/problems/reverse-bits/

Statement

Reverse bits of a given 32 bits unsigned integer.

Note:

Example 1:

Input: n = 00000010100101000001111010011100
Output:    964176192 (00111001011110000010100101000000)

Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000.

Example 2:

Input: n = 11111111111111111111111111111101
Output:   3221225471 (10111111111111111111111111111111)

Explanation: The input binary string 11111111111111111111111111111101 represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is 10111111111111111111111111111111.

Constraints:

The input must be a binary string of length 32

Follow up: If this function is called many times, how would you optimize it?

RULES :

How to name your file?

  1. Go to folder : "/LeetCode/TwoSum/"
  2. Take today's date, i.e. 1stOct
  3. Take your GitHUB username id like "hrithik339", "hacker-boy", etc or anything which you have.
  4. File extension = say ".py" .

This will ensure no file will be conflict and any number of contributors can work on the same issue. If you have any query ask in comments below, kindly follow this pattern strictly.

sushant-iit commented 3 years ago

Working

sushant-iit commented 3 years ago

21 I have created a solution for that. Please merge it.

ranjit7858 commented 3 years ago

18 I have created solution for the issue. Please kindly merge it

Prakhar-Dixit commented 3 years ago

Can we still contribute to this repository or it was only to be get contributed on 1st OCT ?

ayush523 commented 3 years ago

Hi.I have solved this in python.

saptarshisarkar20 commented 3 years ago

Can we still contribute to this repository or it was only to be get contributed on 1st OCT ?

You can

harshpatel2212 commented 3 years ago

@saptarshisarkar20 I would like to work on this issue.