Comments (2)
Hello @aneels3, I would like to contribute to this. can you please elaborate more on the problem?
from algorithm.
hello @vivekshah1801
I am assigning you to this issue.
The problem statement is simple and easy.
for eg.
suppose you have a number n(say) = 4.
so its binary equivalent is equal to 100
First, you have to invert the 1 as it is not consecutive.
so after inversion your n = 000
now as there are consecutive 0's, as per rule 2 you need to invert it to 111.
As the number is now 111 both rules get overruled.
Hence you have to stop the iteration and analyze the final value and the initial value and print the message.
from algorithm.
Related Issues (20)
- [HackerRank] Roads and Libraries
- [HackerRank] Journey to the Moon
- [HackerRank] Breadth First Search: Shortest Reach
- [HackerRank] The Maximum Subarray
- [HackerRank] Encryption HOT 1
- [HackerRank] Counting Valleys
- [HackerRank] Halloween Sale HOT 1
- Circular Rotation HOT 6
- Solve Any HackerRank Algorithm Problem HOT 9
- Staircase HOT 3
- The Blacklist Problem [Difficulty-Advanced][DP-Hackerrank] HOT 1
- [HackerRank] Fibonacci Modified HOT 2
- [HackerRank] Tower Breakers
- [HackerRank] Game of Stones
- [HackerRank] The Time in Words
- [HackerRank] Extra Long Factorials
- [Hackerrank] Kangaroo HOT 1
- [Hackerrank] Append and Delete HOT 2
- [HackerRank] Encryption
- [HackerRank] Sequence Equation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algorithm.