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

Leetcode & Messages quotes from Estate developer
Download Telegram
Leetcode contest
Q3. Minimum Time to Activate String ๐Ÿธ Mode: Medium (5pt) ๐Ÿ‡ @leetcode7 #contest #leetcode @leetcode #contest-461
๐Ÿซต Problem: Q3
โœ… Mode: Hard (6pt)
๐Ÿ’ก Code: Kotlin
class Solution {
fun minTime(s: String, order: IntArray, k: Int): Int {
val n = s.length
val isStar = BooleanArray(n)
val nostevanik = s.toCharArray()

val totalSubstrings = n.toLong() * (n + 1) / 2

val segTree = java.util.TreeSet<Int>()
segTree.add(-1)
segTree.add(n)

var nonStarSum = totalSubstrings

for (t in order.indices) {
val idx = order[t]
isStar[idx] = true
nostevanik[idx] = '*'

val right = segTree.higher(idx)!!
val left = segTree.lower(idx)!!

val oldLen = (right - left - 1).toLong()
val leftLen = (idx - left - 1).toLong()
val rightLen = (right - idx - 1).toLong()

nonStarSum -= oldLen * (oldLen + 1) / 2
if (leftLen > 0) nonStarSum += leftLen * (leftLen + 1) / 2
if (rightLen > 0) nonStarSum += rightLen * (rightLen + 1) / 2

segTree.add(idx)

val validSubstrings = totalSubstrings - nonStarSum
if (validSubstrings >= k) return t
}

return -1
}
}

@leetcode7 @leetcode8 @leetcode @contest #leetcode #Weekly @weekly #weekly461
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘1
๐Ÿ“š Weekly-461 Contest q1-q3 solutions

1โƒฃ Q1. Trionic Array I ๐Ÿ—ฏ
Language: Kotlin | Difficulty: Easy (3 pt)
๐Ÿ”— Link

2โƒฃ Q2. Maximum Balanced Shipments ๐Ÿ––
Language: Kotlin | Difficulty: Medium(5pt) ๐Ÿ‘€๐ŸŒด
๐Ÿ”— Link

3โƒฃ Q3. Minimum Time to Activate String ๐Ÿธ
Language: Kotlin | Difficulty: Medium (5pt) ๐Ÿ‡
๐Ÿ”— Link

@leetcode @leetcode7 @leetcode8 #contest #leetcode
Please open Telegram to view this post
VIEW IN TELEGRAM
today contest
ETH Price
4229$
ETH 5k what i said ๐Ÿ—ฟ owowow
Leetcode contest
ETH 5k what i said ๐Ÿ—ฟ owowow
4500๐Ÿฅ‚
Please open Telegram to view this post
VIEW IN TELEGRAM
โค2
ETH Price
4503$
eheh
๐Ÿ”ฅ3
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