@Neil Agreed, last year I got many hats without trying to - this year I haven't gotten any without trying to
Anonymous
@Quintec I've gotten 5, and I've actually put effort towards getting hats. A lot of the hats are tied to badges, which means it's hard to get them on sites where you already have a lot of rep/badges.
I've gotten 4 not counting still fresh(where trusted user rep counts for some reason) and the one to view SO's team page. 1 silver badge from chat, 2 top hats for answering, and 1 for answering where I'm a new contributor.
I still haven't figured out the retro fan hat though
How many consecutive descending numbers in my number ?
2019 is coming and probably eveyone has noticed the peculiarity of this number : it's in fact composed by two sub-numbers (20 and 19) representing a sequence of consecutive descending numbers.
Challenge
Given a number x, return the length ...
A natural number (written in the decimal base) is qualified as digisible if and only if it fulfills the following 3 conditions:
no of its digits is zero,
all the digits that compose it are different,
the number is divisible by all the digits that compose it.
The challenge is to output all the...
Check List for Duplicates
code-golf
Given a non-empty list of integers, return a truthy value if all entries are unique, and a falsey value of there are duplicate entries (or vice versa).
Examples
[1,2,3] -> false
[1,1,3] -> true
[1] -> false
[1,3,1,5] -> true
META: I couldn't find this as ...
Migrated from chat
Given two non-empty non-negative integer matrices A and B, answer the number of times A occurs as a contiguous, possibly overlapping, submatrix in B.
Examples/Rules
0. There may not be any submatrices
A:
[[3,1],
[1,4]]
B:
[[1,4],
[3,1]]
Answer:
0
1. Submatrices must ...
Is this an interesting challenge? Given a list of strictly positive integers, return the integer that contributes most to the list's sum. E.g. [3,1,1,1,1,1,1,5,9,2,6,5,3,5,8] → 5 (as it contributes 15, while 1 occurs more often, it only contributes 6).
Spice it up a bit? Given a matrix of non-negative integers, return the indices/mask/values of unique rows that contribute most to the total sum of elements in the matrix. E.g. [[1,2,3],[2,0,4],[6,3,0],[2,0,4],[6,3,0],[2,0,4]] → [2,3] or [false,true,true] or [[2,0,4],[6,3,0]]
WIP: Shortest JsFuck code for a number
JsFuck is a language using only []()!+ to run and express anything in JavaScript. Below is a simplified model of JavaScript to express numbers:
Types
Number
String
Boolean (true)
Array
Functions
IEEEdouble(x):
Let \$u\$ is the number in \$\{a\cdot ...
It's not necessarily "trivial", you know that golfing languages sometimes just have the appropriate tools for the job. That's not the case in Python/Java/C/other mainstream languages because they (1) don't have built-in "group elements of list by" commands (2) don't have built-in "select elements that yield maximal results from list" commands. It's indeed easy-ish but definitely sufficient even for main
@Adám It's not much of a difference in my opinion (e.g. my Pyth answer can be modified by 2 or 3 bytes to make it compatible to the other version), but I'm honestly not a fan of extraneous dimensions. IMO you should stick to the matrix case, but of course the decision is yours
Before all celebrations start and I forget, Happy New Year! I created my account earlier this year, and I've felt really welcome by the community, and I've learned a lot both about golfing, constructing languages, and general programming. Thanks for 2018!
Is this an interesting challenge? Given a list of strictly positive integers, return the integer that contributes most to the list's sum. E.g. [3,1,1,1,1,1,1,5,9,2,6,5,3,5,8] → 5 (as it contributes 15, while 1 occurs more often, it only contributes 6).
Given a non-empty matrix of non-negative integers, answer which unique rows contribute most to the sum total of elements in the matrix.
Answer by any reasonable indication, for example a mask of the unique rows order of appearance (or sort order), or indices (zero- or one- based) of those, or a ...
@Adám by "appearance/sort order", you mean that the indices can also refer to the sorted list of the input's unique elements (instead of kept in original order)?
Collapsing numbers
Couldn't find this on here nor oeis.org..
code-golf, integer, sequence
Let's define the a function on natural numbers \$n\$, written as base 10 digits \$d_k\; d_{k-1}\; \dotsc\; d_1\; d_0\$, as follows:
As long as there are equal adjacent digits \$d_i\;d_{i-1}\$, replace ...
*tries to abuse simultaneous collapse* sim 1111116 -> 222226 -> 44446 -> 8886 -> 16166 -> 16112 -> 1622 -> 164 (l2r 1111116 -> 2226 -> 426) Hmm. I think it would still always result in a stable final result. That is, I don't think any cycles exist, but it certainly takes more steps to come to rest.
I don't think cycles are possible, under any variant. You can't sum two digits to anything other than either a single digit (collapses) or a two-digit number starting with 1 and even.
2
A number of the form 1X where X = 2k will never be unstable with itself (it can't be 11, and even if it could, it collapses to 2, which is 1 digit shorter than what we started with anyway)
Balance those Belts! code-challenge ascii-art
In the game Factorio, you transport items around the map using transport belts.
Transport belts are 1x1 tiles, can go in any cardinal direction, and have 2 parallel lanes.
You can also use splitters to split a single belt into 2 belts, a splitter is...
@ETHproductions there's my need to answer challenges so the best way is to go up various user profiles :P (I could've spammed your inbox like hell if I wanted to...)
@EriktheOutgolfer I'll say you don't have to handle that case. (Is there some hat awarded for answering old questions? :p) — ETHproductions1 min ago