CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
99 subscribers
118 photos
3 videos
15 files
40 links
༗ हरे कृष्णा ༗
"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;
Download Telegram
Day 18👾:
Given two strings, one is a text string txt and the other is a pattern string pat. The task is to print the indexes of all the occurrences of the pattern string in the text string. Use 0-based indexing while returning the indices.
Note: Return an empty list in case of no occurrences of pattern.
2🔥2🏆2👍1
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.
👍2🔥2👏21
• 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 | @CodesSnippet

Happy Coding 👨‍💻
🔥73👍3🎉3🆒2🕊1💋1
GitHub releases the free version of GitHub Copilot 👾🥳


• Check it out!!
Copilot Chat

VS Code extension for copilot


@NotCoding | @CodesSnippet

Happy Coding 👨‍💻
🔥98👍6🎉4🤯1💘1
Day 20👾:
You are given two strings of equal lengths, s1 and s2. The task is to check if s2 is a rotated version of the string s1.

Note: The characters in the strings are in lowercase.
🔥2🐳2👍1💯1
Day 21👾:
Given an array arr[] containing only 0s, 1s, and 2s. Sort the array in ascending order.
👍2🔥21💋1
° 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 | @CodesSnippet

Happy Coding 👨‍💻
6🔥5👍3🎉2🕊2
Day 22👾:
Given an integer array citations[], where citations[i] is the number of citations a researcher received for the ith paper. The task is to find the H-index.

H-Index is the largest value such that the researcher has at least H papers that have been cited at least H times.
🔥2👏21👍1
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 | @CodesSnippet

Happy Coding 👨‍💻
2👍2🐳2👏1
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 | @CodesSnippet

Happy Coding 👨‍💻
👍7🔥43🎉3🍾1👾1
Day 23👾:
Given an array of integers arr[]. Find the Inversion Count in the array.
Two elements
arr[i] and arr[j] form an inversion if arr[i] > arr[j] and i < 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.
2👍2👏2
Day 24👾:
Given an array of Intervals arr[][], where arr[i] = [starti, endi]. The task is to merge all of the overlapping Intervals.
2👍2🔥1👏1
Waoo💀
1 attempt


Code : Here
🔥9👍53😁2🎉2👏1
Day 25👾:
Geek has an array of non-overlapping intervals intervals where intervals[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 interval newInterval= [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).
👏32👍2
Day 26👾:
Given a 2D array intervals[][] of representing intervals where intervals[i] = [starti, endi]. Return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
2👍2🔥2🥰1
Day 27👾:
Given two sorted arrays a[] and b[] of size n and m respectively, the task is to merge them in sorted order without using any extra space. Modify a[] so that it contains the first n elements and modify b[] so that it contains the last m elements.
🔥3👍21
Day 28👾:
Given a sorted array, arr[] and a number target, you need to find the number of occurrences of target in arr[].
👍2🔥2🥰1👏1
Day 29👾:
A sorted array of distinct elements arr[] is rotated at some unknown point, the task is to find the minimum element in it.
2👍2🔥2
Day 30👾:
Given a sorted and rotated array arr[] of distinct elements, the task is to find the index of a target key. Return -1 if the key is not found.
👍3🔥2🥰1
Day 31👾:
Given an array arr[] where no two adjacent elements are same, find the index of a peak element. An element is considered to be a peak if it is greater than its adjacent elements (if they exist). If there are multiple peak elements, return index of any one of them. The output will be "true" if the index returned by your function is correct; otherwise, it will be "false".

Note: Consider the element before the first element and the element after the last element to be negative infinity.
👍4🥰1👏1