Your challenge today is to take a multiline string, and output the biggest square contained within the string that includes the top left corner.
A square string is one where:
Each line has the same number of characters
The number of characters on each line is equal to the number of lines.
C...
pet peeve: sites that have stupid lists, with like 4 paragraphs per page, and then you need to click next (which loads a whole new page, doesn't just unhide a div) to view the next 4, and every third page is actually an advert
λ python
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class foo:
... pass
...
>>> class bar:
... pass
...
>>> foo
<class '__main__.foo'>
>>> foo = bar
>>> foo
<class '__main__.bar'>
>>>
class bar():
def __init__(self, a):
self.a = a
class bar(bar):
def __init__(self, a, b):
super(bar, self).__init__(a)
self.b = b
a = bar(1, 2)
print(a.a, a.b)
This ^ works.
However, in my case, the original definition of bar is in foo.py
@Pavel Well, they each handle their own, I can actually do import imaplibext as imaplib and maintain reverse compatibility with imaplib for the most part. While having imaplibext properly reference imaplib so...
@Pavel Yeah, I'm amazed that super and inheritance is smart enough to let a class inherit from itself, but keep the original around long enough that you can redefine it's constructor while still referencing the original one
Expand a number
Your task is to expand an integer greater than 0 in the following manner:
Split the number into decimal digits and for each digit generate a list according to these rules:
if the digit is odd, the list starts with the digit and goes down to 1;
if the digit is even, the list st...
The Challenge
Your task is to create a program where it outputs the following with no input:
a
bb
ccc
dddd
eeeee
ffffff
ggggggg
hhhhhhhh
iiiiiiiii
jjjjjjjjjj
kkkkkkkkkkk
llllllllllll
mmmmmmmmmmmmm
nnnnnnnnnnnnnn
ooooooooooooooo
pppppppppppppppp
qqqqqqqqqqqqqqqqq
rrrrrrrrrrrrrrrrrr
sssssssssssss...
Specifially This one.
Dennis pointed out that the rule that input cannot be an array of lines makes the challenge worse, and I agree with him now. However, the challenge already has several answers, and most of them would become sub-optimal since taking input as a string array would likely be sh...
Interesting question: When browsing answers, is there a type of answer which (assuming it's correct) you always upvote? Such as answers in a given language, answers of a certain code length etc.
@cairdcoinheringaahing Probably not always, but I tend to upvote answers that use language features in innovative ways, use non-obvious algorithms, or use "languages" for non-intended purposes.
For example, this submission written in APL (Dyalog) claims to be 39 bytes. It is 39 characters, but in the TIO link provided in the post (which happens to be an older version that is two characters longer but that does not matter) it says it is 41 characters and 87 bytes. Why does the score coun...