Skip to main content
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
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
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 not deleted user 15968

For challenges involving bitwise commands or manipulation of numbers at the bit level

1 vote

Sort numbers by binary 1's count

Javascript (ECMAScript 6) - 41 Characters Takes an array a as input: a.sort(ພ=(ຟ,ຝ)=>ຟ*ຝ?ພ(ຟ&ຟ-1,ຝ&ຝ-1):(ຝ-ຟ)) Testing (with less obfuscated code): JSFIDDLE a=[19944, 11746, 15342, 21826, 825, 2 …
MT0's user avatar
  • 3,463
1 vote

Summing a sub-square of a quarter of an infinite chessboard

Oracle SQL, 126 bytes This isn't a golfing language and it doesn't have a bitwise XOR operator but: SELECT SUM(x+y-2*BITAND(x,y))FROM(SELECT LEVEL-1 x FROM T CONNECT BY LEVEL<x+2),(SELECT LEVEL-1 y FROM …
MT0's user avatar
  • 3,463