Search Results
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 |
Code-golf is a competition to solve a particular problem in the fewest bytes of source code.
1
vote
How to weight loss easily?
R, 42 40 bytes
function(v)v[which.max(v[,3]%/%v[,2]),1]
Takes input in the form of a data frame with column types of string (it also works with factors), numeric, numeric.
%/% is integer division.
…
3
votes
Is it a balanced number?
R, 105 96 bytes
Turns out R is very verbose. Takes input as a character.
function(x){y<-as.numeric(unlist(strsplit(x,"")));l<-length(y)%/%2;sum(tail(y,l))==sum(head(y,l))}
Formatted nicely:
funct …
0
votes
The Letter A without A
R, 12 bytes
LETTERS[2/2]
Pretty self-explanatory: LETTERS is all the upper case letters, and 2/2 evaluates to 1, so we get the the first element.