This is a program:
import java.util.*;
public class testtekovanje{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int b = sc.nextInt(); // 2
int c = sc.nextInt(); // 3
int d = 2; // 4
int e = 0; // 5
while(b>1){
...
I have lists of grades like [('MATHS', 'A'), ('PHYS', 'A*'), ('ECON', 'B'), ('PHYS', 'B')] in python. I want to only have the highest grade per subject. Is there a golfy way to do that?
Imagine a "language" that consists of an accumulator and two commands: + increases the accumulator value by 1, and * multiplies the accumulator value by 2. The accumulator starts at 0. CMC: Given a nonnegative integer, output the shortest program in this language to set the accumulator to that value.
@RadvylfPrograms Ah, good thinking with the ternary. I was trying to combine the two cases using string slicing, which is probably the shortest way to do it in Python
Inverse function of this challenge
To (properly) multiply an string by an integer, you split the string into characters, repeat each character a number of times equal to the integer, and then stick the characters back together. If the integer is negative, we use its absolute value in the first s...
Idea: A programming language where import trains a transformer AI on your code and the library's code, and has it write out a new program inspired by both
It seems fine, but I guess in future, there needs to be emphasis on avoiding situations where a problem would possibly arise
like creating a url shortened link to a site is obviously going to lead to some issues down the line, especially if it's registered just by a code golfer
URL shorteners / shortened URLs
Every once in a while, we get a challenge that requires fetching some data from the internet. While some of them manage to ban URL shorteners in time, other don't. I propose to forbid them by default because of the following reasons.
URL shorteners that were cre...
> I propose counting all URLs on domains as shortened (and therefore forbidden) if the domain name isn't owned by the same individual/company as the canonical one. Thus, e.g., if the task at hand involves querying api.stackexchange.com, only URLs that belong to Stack Exchange, Inc. may be used in the challenge.
and the ppcg.ga link was used after that loophole was proposed
so now not only are the answers invalid due to external resources, they're invalid due to standard loopholes
which means that even if it's decided to mark everything as invalid because of the external resource issue, they still need to be handled as invalid due to loopholes
@cairdcoinheringaahing why not? The task of the challenge involves opening codegolf.stackexchange.com which belongs to Stack Exchange, Inc. Therefore, only links owned by Stack Exchange, Inc are allowable
I just discovered this site and this is my first question, I hope I'm doing it correctly.
The challenge is the following, you must write a code that prints all the prime numbers of \$n\$ digits. Since this problem is computationally complicated, I think that one way to simplify it is to give a nu...
I will also just bluntly say: I'm not happy deleting 46/50 answers from a post in the first place, especially given that, at the time, all the answers were accepted - and flags on those posts were handled - as valid
If the numbers were lower, I'd be more open to doing so. But deleting literally 92% of 50 answers is a massive amount
I'm saying that I want to avoid having to go through literally two pages of answers deleting every single one of them, and would like to find a resolution that allows me to avoid that
If the site wants them all deleted? Fine, I'll spend an afternoon leaving comments and mass-deleting them. But, I'd rather avoid that if possible
Additionally, that loophole was explicitly allowed:
CMQ: Are infinite lists/generators allowed to be returned for challenges where the output would otherwise be a finite list but you know that logically, the infinite list will end up being equal to the finite list?
More specifically, does anyone know of any existing meta posts explicitly allowing/disallowing this
I know this exists, but that doesn't really cover the case of what I'm asking. It's just saying lazily evaluated lists are allowed. It doesn't state anything about infinite being guaranteed the same as finite