Skip to content

Instantly share code, notes, and snippets.

@pranithan-kang
Last active December 13, 2022 10:20
Show Gist options
  • Save pranithan-kang/fceeb26c99314ee607c21dd3b3ca4198 to your computer and use it in GitHub Desktop.
Save pranithan-kang/fceeb26c99314ee607c21dd3b3ca4198 to your computer and use it in GitHub Desktop.
forget_app_pass_code
# โจทย์
# ----
# ลืมรหัสเข้า app บนมือถือจำได้แค่เพียงว่ารหัสมี 4 หลัก ขึ้นต้นด้วยเลข 6 และหารด้วย 69 และ 96 ลงตัว
# คำถามคือรหัสผ่านคืออะไร
# ที่มาของโจทย์: asiamediasoft
def find_forgotten_passcode():
set_a = {i for i in range(6000, 7000) if i % 69 == 0}
set_b = {i for i in range(6000, 7000) if i % 96 == 0}
return set_b.intersect(set_a)
find_forgotten_passcode()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment