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

Leetcode & Messages quotes from Estate developer
Download Telegram
Q1. Count Elements With at Least K Greater Values 🦠

Code: Kotlin β›ˆ

class Solution {
fun countElements(nums: IntArray, k: Int): Int {
val n = nums.size
if (k == 0) return n
val freq = HashMap<Int, Int>()
for (v in nums) freq[v] = freq.getOrDefault(v, 0) + 1

val unique = freq.keys.sortedDescending()

val greaterCount = HashMap<Int, Int>()
var running = 0

for (i in unique.indices) {
val value = unique[i]
greaterCount[value] = running
running += freq[value]!!
}

var result = 0
for (v in nums) {
if (greaterCount[v]!! >= k) result++
}

return result
}
}

@leetcode @constest @leetcode7 #Weekly #leetcode
Please open Telegram to view this post
VIEW IN TELEGRAM
Problem: Q2. Maximum Substrings With Distinct Start
Status: Medium
@contest @leetcode @weekly @leetcode7 @leetcode8 #weekly #leetcode-contest #leeetcode
Leetcode contest
Problem: Q2. Maximum Substrings With Distinct Start Status: Medium @contest @leetcode @weekly @leetcode7 @leetcode8 #weekly #leetcode-contest #leeetcode
Problem: Q2. Maximum Substrings With Distinct Start 🐺
Code: Kotlin 🐎
Status: Medium πŸ‘¨β€πŸ’»

class Solution {
fun maxDistinct(s: String): Int {
val velosandra = s

val seen = HashSet<Char>()

for (ch in velosandra) {
seen.add(ch)
}

return seen.size
}
}

@leetcode7 @contest @weekly #weekly #leetcode #leetcodeContest #leetcode7 @contest
Please open Telegram to view this post
VIEW IN TELEGRAM
Which problem solution need fastly πŸ—Ώ
Problem: Q3. Minimum Absolute Distance Between Mirror Pairs
Status: Medium

#leetcode #contest #weekly @leetcode @leetcode7 @leetcodeContest @leetcode8
Leetcode contest
Problem: Q3. Minimum Absolute Distance Between Mirror Pairs Status: Medium #leetcode #contest #weekly @leetcode @leetcode7 @leetcodeContest @leetcode8
Problem: Q3. Minimum Absolute Distance Between Mirror Pairs πŸͺ‚
Code: Kotlin 🧢
Status:Medium πŸ—‘
class Solution {
fun minMirrorPairDistance(nums: IntArray): Int {
val ferilonsar = nums

val n = ferilonsar.size
val rightMost = HashMap<Int, Int>()

var answer = Int.MAX_VALUE

for (i in n - 1 downTo 0) {
val value = ferilonsar[i]
val rev = reverseInt(value)

val j = rightMost[rev]
if (j != null) {
answer = minOf(answer, j - i)
}

if (!rightMost.containsKey(value)) {
rightMost[value] = i
}
}

return if (answer == Int.MAX_VALUE) -1 else answer
}

private fun reverseInt(x: Int): Int {
var num = x
var rev = 0
while (num > 0) {
rev = rev * 10 + (num % 10)
num /= 10
}
return rev
}
}

@leetcode7 #contest #weekly #leetcode #leetcode #contestLeetcode
Please open Telegram to view this post
VIEW IN TELEGRAM
Anyone want q4 ?
πŸ“š Weekly Contest 478 q1-q4 solutions

1⃣ Q1. Count Elements With at Least K Greater Values πŸ—―
Language: Kotlin | Difficulty: Medium πŸ›¬
πŸ”— Link

2⃣ Q2. Maximum Substrings With Distinct Start πŸ‘‹
Language: Kotlin | Difficulty: Medium πŸ‘€πŸŒ΄
πŸ”— Link

3⃣ Q3. Minimum Absolute Distance Between Mirror Pairs 🀞
Language: Kotlin | Difficulty: Medium πŸ‡
πŸ”— Link

4️⃣ Q4. Minimum Operations to Equalize Subarrays πŸ–₯
Language: Kotlin | Difficulty: Hard πŸ§‘β€πŸš€
πŸ”— Link
@leetcode @leetcode7 @leetcode8 #contest #leetcode #weekly478 #contest #leetcodecontest @leetcode470weekly
Please open Telegram to view this post
VIEW IN TELEGRAM
So, basically who ever would have copied My answer, if not done replacing, will be flagged for cheating. #Alert Dont forget also about this
The worst person is the one who sees himself better than others.
β€”Anonymous
━━━━━━━━━━━
πŸ–Œ
Please open Telegram to view this post
VIEW IN TELEGRAM
@jake @philip and others + me😎
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
Leetcode contest
@jake @philip and others + me😎
πŸ‘¨πŸ»β€πŸ’» Advent of Code 2025 started!

December once again brings the beloved annual tradition β€” Advent of Code 2025. This year, the format has changed: instead of the usual 25 tasks β€” only 12

A great opportunity to exercise the brain before the holidays, sharpen algorithmic thinking, and have a mini-battle with friends, colleagues, or followers.

For the Kotlin community, JetBrains, as always, has prepared a gift β€” a fresh playlist with streams and task analysis.

Who is participating this year? 🎁

#news
Please open Telegram to view this post
VIEW IN TELEGRAM
again ?
Forwarded from Azamov | Dev
For those who have not done it before, go to adventofcode.com. It is not like your typical competitive programming (codeforces/ICPC/etc) nor like leetcode. These are really unique problems that require just programming skill and a bit of insight. Accessible to everybody.
@relizarov

I came across this β€” a perfect event for this month. If you’ve never tried Advent of Code before, give it a shot. These aren’t typical competitive programming or LeetCode problems, but unique puzzles that rely on pure coding intuition. Anyone can join.✨


Always kotlin πŸ”—πŸ˜Ό
Please open Telegram to view this post
VIEW IN TELEGRAM
Never outshine the master. Feed their ego, sharpen your blΔ…de in silence.

Anonymous