CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
65 subscribers
119 photos
3 videos
15 files
41 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 13 of 30 Days of Coding.👾🫧

GitHub Code :
Link
👍1
👍1
Day 14 of 30 Days of Coding.👾🫧

GitHub Code :
Link
👍1
🫧
👍2🔥1
RGBtoHexColorConvertor.jpg
479.8 KB
Day 15 of 30 Days of Coding.👾🫧

GitHub Code :
Link
👾
👍2🔥1
SquareNumbers.jpg
410.2 KB
Day 16 of 30 Days of Coding.👾🫧

GitHub Code :
Link
Rust ®️👾
🔥4
..
👍1🔥1
print(eval(input("")))
2🔥21👏1👀1
CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
Question 5 : Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1, 2, 3, 1] Output: true Example 2: Input: nums = [1, 2, 3, 4] Output: false…
#include <stdio.h>

int check_dual_int(int arr[], int length) {
for (int i = 0; i < length; i++) {
for(int j=i+1; j< length; j++) {
if(arr[i] == arr[j]) {
return 1;
}
}
}
return 0;
}

int main() {
int arr[] = {1, 2, 3, 1};
int length = sizeof(arr) / sizeof(arr[0]);

if(check_dual_int(arr, length) == 1) {
printf("True");
} else {
printf("False");
};
return 0;
}
🔥2👾2👍1
print(f"{"Boom":_^20}")
👾32👨‍💻2🔥1
Day 01 👾:
Given an array of positive integers arr[] of size n, the task is to find second largest distinct element in the array.
Note: If the second largest element does not exist,
return -1.
👨‍💻2👍1🔥1👾1
Day 02 👾:
Given an array of integers arr[], the task is to move all the zeros to the end of the array while maintaining the relative order of all non-zero elements.
👏3🔥21
Day 03 👾:
Given an array arr[], the task is to reverse the array. Reversing an array means rearranging the elements such that the first element becomes the last, the second element becomes second last and so on.
🔥21👏1👨‍💻1
Day 04 👾:
Given an array of integers arr[] of size n, the task is to rotate the array elements to the left by d positions.
🔥2🕊2👏1
Day 05 👾:
Given an array arr[] of size n, the task is to print the lexicographically next greater permutation of the given array. If there does not exist any greater permutation, then find the lexicographically smallest permutation of the given array.

Let us understand the problem better by writing all permutations of
[1, 2, 4] in lexicographical order

[1, 2, 4], [1, 4, 2], [2, 1, 4], [2, 4, 1], [4, 1, 2] and [4, 2, 1]

If we give any of the above (except the last) as input, we need to find the next one in sequence. If we give last as input, we need to return the first one.
🔥2👨‍💻21
F-strings usage and formats in Python!

Code Examples:

1. Basic F-string:
name = "Chiku"
age = 21
print(f"Name: {name}, Age: {age}")
# Use code and learn.



2. Debugging:
var = 100
print(f"var={var}")
print(f"{var = }")
# Use code and learn.



3. Rounding:
decimal_number = 1234.5678
percent = 0.5678
print(f"Decimal: {decimal_number:.2f}")
print(f"Percent: {percent:.2%}")
# Use code and learn.



4. Thousands separators:
big_number = 1000000
print(f"Big number: {big_number:,}")
# Use code and learn.



5. Date and time formatting:
import datetime
now = datetime.datetime.now()
print(f"Date: {now:%x}")
print(f"Date and time: {now:%c}")
print(f"Time: {now:%H:%M:%S}")
# Use code and learn.



6. Raw strings:
path = fr"C:\Users\{user}\Documents"
# Use code and learn.
# Do not use in big project, use this format for fun only



7. Alignment:
text = "Chiku"
print(f"{text:>20}") # Right align
print(f"{text:^20}") # Center align
print(f"{text:<20}") # Left align
# Use code and learn.



8. Custom F-string class:
class Text:
def __init__(self, text):
self.text = text

def __format__(self, format_spec):
if format_spec == "upper":
return self.text.upper()
elif format_spec == "lower":
return self.text.lower()
elif format_spec == "count":
return str(len(self.text))
else:
raise ValueError(f"Invalid format specifier: {format_spec}")

text = Text("Chiku")
print(f"{text:upper}")
print(f"{text:lower}")
print(f"{text:count}")
# Use code and learn.
3🔥3
Day 06 👾:
Given an array arr[] consisting of n integers, the task is to find all the array elements which occurs more than floor(n/3) times.

Note: The returned array of majority elements should be sorted.
🔥3👏3
Creating Virtual Environment for Python

» Download Python
First you need python installed in your local machine to create virtual environment.
Download Python from Here



» Steps to create '.env' folder (virtual environment for python)
1. Navigate to the folder where you want to make your project
Example:

cd D:/code/


2. Open terminal (local terminal, command prompt, or vs code terminal) in that folder

3. Now, use these commands
python --version # Type this and hit enter to verify the python version


# Now use these commands
python -m venv .env


4. Your virtual environment is created in that folder, now activate this virtual environment using this command.

Command for 'Command Prompt':
.\env\Scripts\activate


Command for 'Powershell':
.\env\Scripts\Activate.ps1


Command for Git Bash or WSL:
source \.env\bin\activate


If Powershell gives you error like File cannot be loaded because running scripts is disabled then use this command!
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass


5. Congratulations🎊 Your virtual environment activated now make your project


Happy Coding 👨‍💻
🐳31👍1🕊1