Post image
Light Mode
Dark Mode
Repeat Built-in Functions And Find The Best Crossing Of Words

Hello, checkiomates๐Ÿฑโ€๐Ÿ‘ค!

In this digest we offer you a guide with basics of built-in functions. A few of them you may immediately try in a new mission about crossing words!

๐Ÿ’กTIP

On Easy difficulty, each of the few starting stations is dedicated to a distinct data type. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

๐ŸMISSION

Crossed Words by freeman_lex -

Given a horizontal word and a vertical word, your task is to find the best crossing letter between them, defined as the letter that allows the rightmost crossing in the horizontal word and, in the event of a tie, the lowest crossing in the vertical word. You need to return a tuple of two integers: 1-based indexes of common letter in horizontal and vertical words respectively. If there is no common letter return -1, -1.

crossed_words("PATO", "PELE") == (1, 1)
crossed_words("ANJO", "MENTORA") == (4, 5)
crossed_words("URUBU", "POLIVALENTE") == (-1, -1)

๐Ÿ“–ARTICLE

Python's Built-in Functions: A Complete Exploration -

Python has many built-in functions that you can use directly without importing anything. These functions cover a wide variety of common programming tasks that include performing math operations, working with built-in data types, processing iterables of data, handling input and output in your programs, working with scopes, and more.

๐Ÿ‘ฉโ€๐Ÿ’ปCODE SHOT

How do you think, what the following code does?

def ????????(values: set, one: int) -> int:
    
    return min(values, key=lambda k: (abs(k-one), k))

๐Ÿ™Œ Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! โคต

Created: July 15, 2024, 9:18 a.m.
0
41
User avatar
freeman_lex