Leetcode contest
565 subscribers
176 photos
7 videos
2 files
59 links
Main channel @azamovme

Leetcode & Messages quotes from Estate developer
Download Telegram
Forwarded from Azamov | Dev (Azamov)
Happy Telegramโ€™s Birthday 1โƒฃ2โƒฃ
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ˜2
This media is not supported in your browser
VIEW IN TELEGRAM
People who bought Ethereum at $1400 such as me ๐Ÿ—ฟ
Tomorrow Contest
I am backking after all exams
and tomorrow really will be contest and i will also be in contest
๐Ÿ‘2
F&ck my work I was sleeping. I will make caller bot ๐Ÿ˜ญ๐Ÿ˜ญ ๐Ÿ˜Ÿ
๐Ÿ˜2๐Ÿคฃ2
I am really sorry for all. ๐Ÿ˜ญ๐Ÿ˜ญ
๐Ÿ™ˆ2
Please don't misunderstand me
โค3
Any new idea can write me using direct func or @saikou
leet T Shirt soon
๐Ÿ˜8๐Ÿ—ฟ6๐Ÿ†’3
Leetcode contest
In this channel help tou u with weekly contest join us and improve ur rank )
๐ŸŽ‰ 1.5 years of challenging myselfโ€ฆ and finally . ๐Ÿ’ช Solved 700 LeetCode problems.
โœ… Celebrating this milestone with a LeetCode T-shirt ๐Ÿ‘•.
Every line of code, every algorithm โ€“ a fruit of patience and hard work ๐Ÿš€.
#CodingLife #LeetCode #Achievement
Please open Telegram to view this post
VIEW IN TELEGRAM
1โค7๐Ÿ“2๐Ÿ—ฟ1
Leetcode contest
๐Ÿ˜ฎ
i remember that day it was my first achieve
โค5
i am ready for tomorrow ๐Ÿ‘Œ ๐Ÿ‘Œ
Please open Telegram to view this post
VIEW IN TELEGRAM
Hello guys
we will start
Title: Q1. Restore Finishing Order
Status: Easy
#leetcode #contest @leeetcode7 #weekly-465
Problem: Q1โ—€๏ธ
Status: Accepted
Mode: Easy๐Ÿ—ฝ
Code: Kotlin๐Ÿฝ

class Solution {
fun recoverOrder(order: IntArray, friends: IntArray): IntArray {
val friendsSet = friends.toSet()
val result = mutableListOf<Int>()

for (id in order) {
if (id in friendsSet) {
result.add(id)
}
}

return result.toIntArray()
}
}


@leetcode @leetcode7 @contest #leetcode #weekly-465 #wcontest
Please open Telegram to view this post
VIEW IN TELEGRAM
Somone need fastly dm me @saikou )
Title: Q2. Balanced K-Factor Decomposition
Status: Medium ๐Ÿง‘โ€โš•๏ธ
@leetcode #leetcode #contest #weekly
Please open Telegram to view this post
VIEW IN TELEGRAM
Leetcode contest
Title: Q2. Balanced K-Factor Decomposition Status: Medium ๐Ÿง‘โ€โš•๏ธ @leetcode #leetcode #contest #weekly
Problem: Q2. Balanced K-Factor Decomposition ๐Ÿ––
Status: Medium ๐ŸงŸโ€โ™‚๏ธ
class Solution {
public:
vector<int> best;
int min_diff = INT_MAX;

vector<int> get_divisors(long long x) {
vector<int> res;
for (long long i = 1; i * i <= x; ++i) {
if (x % i == 0) {
res.push_back(i);
if (i != x / i) res.push_back(x / i);
}
}
sort(res.begin(), res.end());
return res;
}

bool can_choose(long long d, int left, long long rem) {
long long pow = 1;
for (int i = 0; i < left; ++i) {
if (pow > numeric_limits<long long>::max() / d) {
return false;
}
pow *= d;
if (pow > rem) {
return false;
}
}
return true;
}

void dfs(long long rem, int left, int last_min, vector<int>& curr) {
if (left == 1) {
if (rem >= last_min) {
curr.push_back(rem);
int diff = curr.back() - curr[0];
if (diff < min_diff) {
min_diff = diff;
best = curr;
}
curr.pop_back();
}
return;
}
vector<int> divs = get_divisors(rem);
for (int d : divs) {
if (d >= last_min) {
if (can_choose(d, left, rem)) {
curr.push_back(d);
dfs(rem / d, left - 1, d, curr);
curr.pop_back();
}
}
}
}

vector<int> minDifference(int n, int k) {
int sulmariton = n;
vector<int> curr;
dfs(n, k, 1, curr);
return best;
}
};

@leetcode7 @leetcode #contest #leetcode
Title: Q3. Maximum Product of Two Integers With No Common Bitsยฉleetcode
Status: Medium (5pt)
@leetcode @leetcode7 #contest