We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
static long strangeCounter(long t) {
/*
* Write your code here.
*/
// System.out.println("value of t"+t);
// long rem=t%3;
// long count=t/3;
long stable=0;
long temp=3;
for(long i=1;i<=t;i=i+temp){
if(i==1){
continue;
}
else{
temp=temp*2;
}
Strange Counter
You are viewing a single comment's thread. Return to all comments →
static long strangeCounter(long t) { /* * Write your code here. */ // System.out.println("value of t"+t); // long rem=t%3; // long count=t/3; long stable=0; long temp=3; for(long i=1;i<=t;i=i+temp){ if(i==1){ continue; } else{ temp=temp*2; }