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

Leetcode & Messages quotes from Estate developer
Download Telegram
class Solution {
public int minimumTime(int[][] grid) {
if (grid[0][1] > 1 && grid[1][0] > 1) {
return -1;
}
int m = grid.length, n = grid[0].length;
int[][] dist = new int[m][n];
for (var e : dist) {
Arrays.fill(e, 1 << 30);
}
dist[0][0] = 0;
PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> a[0] - b[0]);
pq.offer(new int[] {0, 0, 0});
int[] dirs = {-1, 0, 1, 0, -1};
while (true) {
var p = pq.poll();
int i = p[1], j = p[2];
if (i == m - 1 && j == n - 1) {
return p[0];
}
for (int k = 0; k < 4; ++k) {
int x = i + dirs[k], y = j + dirs[k + 1];
if (x >= 0 && x < m && y >= 0 && y < n) {
int nt = p[0] + 1;
if (nt < grid[x][y]) {
nt = grid[x][y] + (grid[x][y] - nt) % 2;
}
if (nt < dist[x][y]) {
dist[x][y] = nt;
pq.offer(new int[] {nt, x, y});
}
}
}
}
}
}


https://leetcode.com/problems/minimum-time-to-visit-a-cell-in-a-grid/?envType=daily-question&envId=2024-11-29
๐Ÿ˜ฎ
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ—ฟ๏ธ๏ธ๏ธ๏ธ๏ธ๏ธ
responsive UI in flutter ๐Ÿ˜ฎ
Please open Telegram to view this post
VIEW IN TELEGRAM
def raqamlar_yigindisi(n):
if n < 10: #
return n
else:
return n % 10 + raqamlar_yigindisi(n // 10)
Berilgan N natural sonning raqamlari yig'indisini rekursiv funksiya yordamida hisoblang.
simple logic
Hehe
Some one wait today
Contests
Leetcode contest
Hehe
This media is not supported in your browser
VIEW IN TELEGRAM
๐Ÿ—ฟ
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘4
whats goin on ๐Ÿ—ฟ
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ”ฅ2
happy new year guys
โค3๐Ÿ‘2
we back next month ready for next month ) with gifts )
๐Ÿ”ฅ2
Well guys, I have completed my plan and carefully structured it. My challenge starts on Thursday because I know you don't care about the reason ๐Ÿ—ฟ

Challenge Plan:
- Every day, I will read 15-20 pages from The Art of Invisibility by Kevin Mitnick. After every chapter, I will post my overall thoughts in this channel.
- Every day, I will solve one problem from LeetCode in java python kotlin (since we are learning it at university).
- Every day, I will watch a video from Professor Messer's channel related to my major. For now, I have chosen the Network+ certification course.

I believe this plan is enough because if the tasks are too difficult, motivation tends to decrease.

Wish me luck๐Ÿ˜

@leetcode7
Please open Telegram to view this post
VIEW IN TELEGRAM