Intra AUST Preliminary Round (Senior group) Editorial

Contest link : https://www.hackerrank.com/contests/intra-aust-preliminary-round-senior-group/challenges

Diamond lover : Just implement the diamond shape and carefully calculate the spaces between the diamonds.
Easy to solve 1 : From 0 to N, if we X-OR all the integers, we get a binary representation which length is exactly the same length as N. As N is large, using brute force to generate result won’t help. We just need to find the binary representation of N and replace every digit with “1”. The decimal format of that is the answer.
Strength check :  Just check all the information about the password is whether present in the string or not.
Can you solve it? : It’s a bit manipulation problem. If you are familiar with the concept of bit handling it should be easy for you. However, I found a pattern and solved it accordingly. Here is how : Can you solve it?
Longest String : A simple brute force will be enough for the solution. Just implement the code and keep in mind about the alphabetical order.

Advertisements