Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 16413

Code-golf is a competition to solve a particular problem in the fewest bytes of source code. If you want to score by characters instead of bytes, please state this explicitly in the challenge. If source code length is not the primary scoring criterion, consider using another tag instead.

0
votes
Java, 182 bytes These solutions are horrendously long. =( Note: These print in local time, and suppresses leading zeros for the hour. java.util.Date has deprecated API. // 183 bytes when linebreaks …
answered Sep 12 '15 by Nayuki
1
vote
Python, 309 301 288 chars Compact version: q=p,b=" || "," (__) " t="|| %s ||\n" a=lambda h:t%"".join(q[i]for i in h) n=[int(d)for d in str(input())] c=len(n) e="="*(c*6+2) h="|\\"+e+"/|" print h+" …
answered Feb 13 '14 by Nayuki
5
votes
Java, 568 bytes Not the strongest language for golfing, but here is my earnest attempt: import java.awt.image.*;class G{public static void main(String[]b)throws Exception{int n=Integer.parseInt(b[0] …
answered Oct 14 '16 by Nayuki
4
votes
Python 3: 140 134 113 characters Short version - short and sweet, fits in a tweet (with thanks to miles): from math import* def f(v): n=len(v) if n<2:return v a,b=f(v[::2])*2,f(v[1::2])*2;retur …
answered Apr 14 '14 by Nayuki
3
votes
Java (64, 61, 41 bytes) Completely straightforward using the standard library (Java SE 5+): int f(long n){return Long.bitCount(Double.doubleToLongBits(n));} Contribution by Kevin Cruijssen (Java SE …
answered Jul 30 '17 by Nayuki