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

Leetcode & Messages quotes from Estate developer
Download Telegram
Problem: Q2. Maximize Sum of Squares of Digits πŸ––
Status: Medium πŸ§Ÿβ€β™‚οΈ @leetcode @leetcode7 @contest #biweekly
Please open Telegram to view this post
VIEW IN TELEGRAM
Leetcode contest
Problem: Q2. Maximize Sum of Squares of Digits πŸ–– Status: Medium πŸ§Ÿβ€β™‚οΈ @leetcode @leetcode7 @contest #biweekly
🫡 Problem: Q2. Maximize Sum of Squares of Digits
βœ… Mode: Medium
πŸ’‘ Code: Java

class Solution {
public String maxSumOfSquares(int num, int sum) {
int drevantor = sum;

if (sum > 9 * num) return "";
if (sum < 0) return "";

StringBuilder sb = new StringBuilder();

for (int i = 0; i < num; i++) {
int digit = Math.min(9, sum);
sb.append(digit);
sum -= digit;
}

if (sum > 0) return "";

return sb.toString();
}
}

#leetcode @contest @leetcode #biweekly ⏳
Please open Telegram to view this post
VIEW IN TELEGRAM
Q3. Minimum Operations to Transform Array
Status: Medium
#leetcodecontest #leetcode #contest
Problem: Q4. Count Ways to Choose Coprime Integers from Rows 🎁
@leetcode @contest #biweekly
Please open Telegram to view this post
VIEW IN TELEGRAM
Leetcode contest
Problem: Q4. Count Ways to Choose Coprime Integers from Rows 🎁 @leetcode @contest #biweekly
πŸ™ Problem: Q4
🀫 Mode: Hard (6pt)
πŸ‘¨β€πŸŽ¨ Code: Java

class Solution {
public int countCoprime(int[][] mat) {
int m = mat.length;
int n = mat[0].length;
int mod = 1000000007;


int[][] morindale = mat;

int maxVal = 0;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
maxVal = Math.max(maxVal, mat[i][j]);
}
}

long[][] dp = new long[m + 1][maxVal + 1];
dp[0][0] = 1;
for (int i = 0; i < m; i++) {
for (int g = 0; g <= maxVal; g++) {
if (dp[i][g] == 0) continue;
for (int j = 0; j < n; j++) {
int num = mat[i][j];
int newGcd = gcd(g, num);
dp[i + 1][newGcd] = (dp[i + 1][newGcd] + dp[i][g]) % mod;
}
}
}

return (int) dp[m][1];
}

private int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
}

@leetcode7 #contest #leetcode #biweekly
Please open Telegram to view this post
VIEW IN TELEGRAM
Leetcode contest
Q3. Minimum Operations to Transform Array Status: Medium #leetcodecontest #leetcode #contest
Problem:Q3. ✊
Status: Hard 🌴
Code: Kotlin πŸŽ„
class Solution {
fun minOperations(nums1: IntArray, nums2: IntArray): Long {
val travenior = nums1.toMutableList()

val n = nums1.size
val x = nums2[n].toLong()

var baseSum = 0L
var bestExtra = Long.MAX_VALUE

for (i in 0 until n) {
val a = nums1[i].toLong()
val b = nums2[i].toLong()
baseSum += kotlin.math.abs(a - b)

val l = kotlin.math.min(a, b)
val r = kotlin.math.max(a, b)

val dist = when {
x < l -> l - x
x > r -> x - r
else -> 0L
}
val extra = dist + 1L
if (extra < bestExtra) bestExtra = extra
}

return baseSum + bestExtra
}
}

@leetcode7 @contest #leetcode #biweekly
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
Tomorrow contest @leetcode7 @leetcode8
Sozo TV β€” Android TV
Sozo is crafted with a perfect blend of simplicity and state-of-the-art elegance. It is designed as an Anilist only client, offering users the ability to stream and download their favorite Anime, Manga, Movies, and TV Shows.

✨ Why it's amazing
πŸ”— Get it: Telegram
πŸ“² Screenshots
πŸ“„ Source Code

❀️ Sincerely: @SeedOSS
Farmers who wait for the perfect weather never plannt.

━━━━━━━━━━━
πŸ–Œ @saikou πŸ“
Please open Telegram to view this post
VIEW IN TELEGRAM
😁6
Forwarded from Programmer Jokes
🀣6
Privacy is power. What people don't know, they can't ruin.

@saikou
πŸ”₯2
Tomorrow contest @leetcode7 @leetcode8
Java
😏 Java kvargs πŸ—Ώ
😏
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from Azamov | Dev
Perhaps the thing I'm most worried about in the future of AI and autofill is that I don't want to see ads in code either

#ai
Discipline is doing what needs to be done, even if you don't want to do it.

Anonymous #quote
Forwarded from π—½π—Όπ—½π— π—’𝗗𝗦 | 𝗙𝗒𝗦𝗦, π—Ÿπ—Άπ—³π—², π— π—²π—Ίπ—²π˜€ (κ‘­ π™Šπ™‹π™π™„π™ˆπ’Šπ’›π’†π’“ ལས་འཆདྷ)
Sozo for AndroidTV

Sozo is crafted with a perfect blend of simplicity and state-of-the-art elegance. It is designed as an Anilist only client, offering users the ability to stream and download their favorite Anime & Manga for AndroidTV too

πŸ”— Links:
- Download
- Screenshots
- Support
- Source code
Developer: ProfessorDeveloper

❀️ Support the Project

If this project makes your life easier, here are a few quick ways to show some love:

⭐ Star the repo/app
β˜• Buy a coffee for the developer
πŸ›  Contribute code, issues, or pull-requests


⚠️ This app might be breaking copyright laws, use at your own risk. We are not responsible for anything. We are just sharing open source software.

🏷 Tags: #Anime #Movie #AndroidTV
❀3
#today #biweekly #leetcode #contest , today i cant participate
Guys sorry i just trouble with sending
i just solved tomorrow questions .