Bit Manipulation Exercise
1 Answer
Bit Manipulation Exercise
| Flag | PURGE
How might you solve this? Write a method that return the number corresponding to a pattern of bits of length n consisting of consecutive 1s of p length and consecutive 0s of q length. The sample input of p=3, q=3,and n=18 should produce the result "000111000111000111" whereas an input of p=4, q=2, and n=15 would produce the result "111001111001111".
- Anthony Mays July 26, 2013Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
here is a java based solution
- skipper1penguin July 27, 2013