CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
Open in Telegram
༗ हरे कृष्णा ༗ "Lost in my own cosmos 💫 | Coding Need Patience 🥀🐾" ❝Face the failure, Until the Failure fails to face you.❞ — Dreamer » ChikuX69.netlify.app « DM ? " @ChikuXBot " : 404;
Show more376
Subscribers
No data24 hours
-57 days
-48430 days
Posts Archive
Day 28👾:
Given a sorted array,arr[]and a numbertarget, you need to find the number of occurrences oftargetinarr[].
Day 27👾:
Given two sorted arraysa[]andb[]of sizenandmrespectively, the task is to merge them in sorted order without using any extra space. Modifya[]so that it contains the firstnelements and modifyb[]so that it contains the lastmelements.
Day 26👾:
Given a 2D arrayintervals[][]of representing intervals whereintervals[i] = [starti, endi]. Return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Day 25👾:
Geek has an array of non-overlapping intervals intervals whereintervals[i] = [starti, endi]represent the start and the end of the ith event and intervals is sorted in ascending order by starti. He wants to add a new intervalnewInterval= [newStart, newEnd]where newStart and newEnd represent the start and end of this interval. Help Geek to insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).
Day 24👾:
Given an array of Intervalsarr[][], wherearr[i] = [starti, endi]. The task is to merge all of the overlapping Intervals.
Day 23👾:
Given an array of integersarr[]. Find the Inversion Count in the array. Two elementsarr[i]andarr[j]form an inversion ifarr[i] > arr[j]andi < j. Inversion Count: For an array, inversion count indicates how far (or close) the array is from being sorted. If the array is already sorted then the inversion count is 0. If an array is sorted in the reverse order then the inversion count is the maximum.
• Are You Feeling Lucky? Try This Python Number Guessing Game! 😁 •
› Implementation of number guessing game in telegram bot using Pyrofork (a fork repository of pyrogram official)
NOTE: Make sure you created a virtual environment before trying this if you trying in your local mechanic of your existing Pyrogram bot. If you don't know how to create virtual environment then follow this post on creation of virtual environment!· Requirements
pip install pyrofork
· Code (main.py)
from pyrogram import Client, filters
from pyrogram.types import Message, KeyboardButton, ReplyKeyboardMarkup
import random
app = Client(
'bot',
api_id=18551492,
api_hash='9046713fdc162e06212f23e0e2047b4b',
bot_token=''
)
@app.on_message(filters.command('start'))
async def game(client, m: Message):
welcome_msg = f"Hey {m.from_user.first_name}, This is number guessing gamee developed by Chiku!\nTry it!\nYou have to guess a number from 0 to 10. I'll calculate the number of attempts taken by you!!\nLet's Have fun.\n"
button = ReplyKeyboardMarkup(
[
[KeyboardButton("Gamee")]
],
resize_keyboard=True
)
await m.reply(
welcome_msg,
reply_markup=button
)
@app.on_message(filters.regex('Gamee'))
async def gamee(client, m: Message):
comp = random.randint(0, 10)
count = 1
await m.reply("Best of luck buddy!")
while True:
try:
user_input = await client.ask(m.chat.id, "Guess The number: ")
user_input = int(user_input.text)
if user_input == comp:
await m.reply(f"\nCongratulations, You win!!\nThe number is {comp}\nYour number of attempt is {count}")
break
elif user_input > comp:
await m.reply("Think smaller number!")
count += 1
elif user_input < comp:
await m.reply("Think Bigger number!")
count += 1
except:
await m.reply("Invalid Input, Please give a valid number from 0 to 10!")
print("Bot Polling..")
app.run()
· Try to implement and try if you can improvee🧑💻
@NotCoding | @CodesSnippetHappy Coding 👨💻
• Number Guessing Game •
A number guessing game that will give you infinite chance to guess correct number generated by system, and it will count the number of attempts taken by you!! Let's test it, and have fun! This is only for fun and for knowledge on error handling, loops, conditionals operators, etc.Code:
import time
import random
def number_guessing():
comp = random.randint(0, 10)
count = 1
while True:
try:
user_input = int(input("You: "))
if user_input == comp:
print(f"\nCongratulations, You win!!\nThe number is {comp}\nYour number of attempt is {count}")
break
elif user_input > comp:
print("Think smaller number")
count += 1
elif user_input < comp:
print("Think Bigger number")
count += 1
except:
print(f"Invalid input")
def main():
name = input("Enter your name: ")
welcome_msg = f"Hey {name}, This is number guessing gamee developed by Chiku!\nTry it!\nYou have to guess a number from 0 to 10. I'll calculate the number of attempts taken by you!!\nLet's Have fun.\n"
for char in welcome_msg:
print(char, end='', flush=True)
time.sleep(0.05)
print()
number_guessing()
if __name__ == "__main__":
main()
› Try it and do improvement if you have better idea, use your knowledge 🧑💻❣️
@NotCoding | @CodesSnippetHappy Coding 👨💻
Day 22👾:
Given an integer arraycitations[], wherecitations[i]is the number of citations a researcher received for theithpaper. The task is to find theH-index.H-Indexis the largest value such that the researcher has at leastHpapers that have been cited at leastHtimes.
° Ages of Operating Systems👾 °
📂 Windows 11 (3 years old) 🪟 Windows 10 (8 years old) 🍎 macOS Yosemite (10 years old) 🐉 Kali Linux (11 years old) 💻 Windows 8 (12 years old) 🌐 Manjaro (11 years old) 💻 Windows 7 (14 years old) 🖥️ Windows Vista (17 years old) 🌿 Linux Mint (18 years old) 🐧 Ubuntu (20 years old) ⚙️ Fedora (20 years old) 🔧 OpenSUSE (20 years old) ⚙️ CentOS (20 years old) 🐧 Arch Linux (22 years old) 🍏 macOS (22 years old) 💻 Windows XP (23 years old) 🖥️ Windows 2000 (24 years old) 📱 Windows 98 (25 years old) 🌍 Windows 95 (28 years old) 💻 Windows 3.1 (29 years old) 🖥️ OS/2 (32 years old) 🐧 Debian (31 years old) 🔴 Red Hat Linux (30 years old) 🎮 AmigaOS (34 years old) 🖥️ Xenix (40 years old) 📀 VMS (44 years old) 💾 MS-DOS (42 years old) 💾 CP/M (49 years old) 🖥️ Unix (54 years old)
Created By :- The Coding Wizard
@NotCoding | @CodesSnippetHappy Coding 👨💻
Day 21👾:
Given an arrayarr[]containing only0s,1s, and2s. Sort the array in ascending order.
Day 20👾:
You are given two strings of equal lengths,s1ands2. The task is to check ifs2is a rotated version of the strings1. Note: The characters in the strings are in lowercase.
GitHub releases the free version of GitHub Copilot 👾🥳• Check it out!!
› Copilot Chat
› VS Code extension for copilot
@NotCoding | @CodesSnippetHappy Coding 👨💻
• Simple Button Effects •
› Simple button with filling effect using HTML and CSS• HTML
<button class="btn">
<span>
Hover Me
</span>
</button>
• CSS
html,
body {
display: flex;
justify-content: center;
align-items: center;
background-color: #2b2b2b;
height: 100%;
}
.btn {
background-color: #ffffff;
transform: scale(2);
border: none;
color: #000000;
border-radius: 5px;
overflow: hidden;
position: relative;
z-index: 1;
font-family: cursive;
transition: all 1s ease-in-out;
}
.btn::after {
content: "";
background-image: linear-gradient(
45deg,
#4ea8de,
#48bfe3,
#56cfe1,
#64dfdf,
#72efdd,
#80ffdb
);
height: 100%;
width: 0;
position: absolute;
bottom: 0;
left: 0;
z-index: 0;
transition: all 1s ease-in-out;
}
.btn:hover::after {
width: 100%;
}
.btn:hover {
box-shadow: 0px 0px 10px #4ea8de, 0px 0px 10px #48bfe3, 0px 0px 10px #56cfe1,
0px 0px 10px #64dfdf;
}
.btn span {
position: relative;
z-index: 2;
}
For demo visit Here
· Go and check and add more effect using your knowledge and share (●'◡'●)
@NotCoding | @CodesSnippetHappy Coding 👨💻
Day 19👾:
Given a string s, the task is to find the minimum characters to be added at the front to make the string palindrome.
Note: A palindrome string is a sequence of characters that reads the same forward and backward.Day 18👾:
Given two strings, one is a text stringtxtand the other is a pattern stringpat. The task is to print the indexes of all the occurrences of the pattern string in the text string. Use0-basedindexing while returning the indices. Note: Return an empty list in case of no occurrences of pattern.
Day 17👾:
Given a string s consisting of lowercase Latin Letters. Return the first non-repeating character ins. If there is no non-repeating character,return '$'. Note: When youreturn '$'driver code will output-1.
° Telegram Formatting °
Telegram supports text formatting in messages using Markdown or HTML. This allows you to style your messages with bold, italic, links, inline code, and more.
› Formatting in HTML
› Formatting in MARKDOWN1. Bold
**bold**
2. Italic
__italic__
3. Underline
--underline--
4. Monospace
`inline fixed-width code`
5. Spoiler
||spoiler||
6. Strikethrough
~~strike~~
7. URL or Link
[text URL](https://telegram.me/NotCoding)
8. Inline Mention
[text user mention](tg://user?id=5217486447)
9. Pre Formatted
```
pre-formatted```
10. Quote or Blockquote
> Quoted text
@NotCoding | @CodesSnippetHappy Coding 👨💻
