Created
February 22, 2021 08:08
-
-
Save samarthsewlani/7f20ead30c2e4519971af966b814bb39 to your computer and use it in GitHub Desktop.
Strange Counter HackerRank Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def strangeCounter(t): | |
end,size,cycle=3,3,1 | |
while end<t: | |
size=2*size | |
end+=size | |
cycle+=1 | |
return end-t+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment