Leetcode contest
Title: Q4. Maximum Bitwise AND After Increment Operations 😮 Code: Kotlin 🚦 Status: Hard 🙌 @leetcode7 @leetcode8 #contest #weekly484
Title: Q4. Maximum Bitwise AND After Increment Operations 😮
Code: Kotlin😛
Status: Hard👾
@leetcode7 @leetcode8 #contest #weekly484
Code: Kotlin
Status: Hard
class Solution {
fun maximumAND(nums: IntArray, k: Int, m: Int): Int {
val clyventaro = nums
val n = clyventaro.size
var best = 0
val costs = LongArray(n)
val limit = k.toLong()
for (bit in 30 downTo 0) {
val candidate = best or (1 shl bit)
if (canMake(candidate, clyventaro, m, limit, costs)) {
best = candidate
}
}
return best
}
private fun canMake(mask: Int, arr: IntArray, m: Int, k: Long, costs: LongArray): Boolean {
for (i in arr.indices) {
val a = arr[i].toLong()
var y = 0L
var greater = false
for (p in 30 downTo 0) {
val need = (mask ushr p) and 1
val bitA = ((a ushr p) and 1L).toInt()
val bitY = if (greater) {
need
} else {
if (need == 1) {
if (bitA == 1) 1 else { greater = true; 1 }
} else {
bitA
}
}
y = (y shl 1) or bitY.toLong()
}
costs[i] = y - a
}
costs.sort()
var used = 0L
for (i in 0 until m) {
used += costs[i]
if (used > k) return false
}
return true
}
}@leetcode7 @leetcode8 #contest #weekly484
Please open Telegram to view this post
VIEW IN TELEGRAM
🙏2
Language: Kotlin | Difficulty: Medium
Language: Kotlin | Difficulty: Medium
Language: Kotlin | Difficulty: Medium
Language: Kotlin | Difficulty: Hard
@leetcode @leetcode7 @leetcode8 #contest #leetcode #weekly478 #contest #leetcodecontest @leetcode484weekly
Please open Telegram to view this post
VIEW IN TELEGRAM
❤3
Forwarded from Sozo App
Watch today’s El Clásico in HD quality on our app.Enjoy football in your preferred language in the TV Garden section, under Sports, on Match TV or other TV channels. ⚽️
Enjoy it
Enjoy it
Please open Telegram to view this post
VIEW IN TELEGRAM
Creational patterns play a fundamental role in developing scalable and maintainable software, providing structured solutions for creation and management of complex objects. In this
chapter, we have explored four creational patterns: Singleton, Factory, Builder, and Dependency Injection, each with
characteristics and use cases that respond to different problems
in the development of Android apps
#creationalPatterns #conclusion
chapter, we have explored four creational patterns: Singleton, Factory, Builder, and Dependency Injection, each with
characteristics and use cases that respond to different problems
in the development of Android apps
#creationalPatterns #conclusion
Forwarded from AppFiles - Mobile Development
Sozo Tv - плеер для аниме и кино
🇸🇱 Проект нашего читателя, присоединяйтесь!
Sozo создан с идеальным сочетанием простоты и современной элегантности. Это клиент, разработанный для Anilist и других платформ, предоставляет пользователям возможность транслировать и скачивать любимые аниме, мангу, фильмы и сериалы.
Sozo Tv на GitHub: https://github.com/professorDeveloper/sozo-tv
Платформа: Android
⭐️: 42
👨🦯➡️ AppFiles: код, инструменты, практики, производительность
Sozo создан с идеальным сочетанием простоты и современной элегантности. Это клиент, разработанный для Anilist и других платформ, предоставляет пользователям возможность транслировать и скачивать любимые аниме, мангу, фильмы и сериалы.
Sozo Tv на GitHub: https://github.com/professorDeveloper/sozo-tv
Платформа: Android
⭐️: 42
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4
AppFiles - Mobile Development
Sozo Tv - плеер для аниме и кино 🇸🇱 Проект нашего читателя, присоединяйтесь! Sozo создан с идеальным сочетанием простоты и современной элегантности. Это клиент, разработанный для Anilist и других платформ, предоставляет пользователям возможность транслировать…
Guys if possible lets support this with reactions Thanks for all ☺️
👍1
Forwarded from #еслатма
The devil can`t make hell look beautiful, he makes beautiful roads that lead there.
Forwarded from LeetCodin (Bek T💻)
Scaling PostgreSQL to power 800 million ChatGPT users
https://openai.com/index/scaling-postgresql/
Maqola juda qiziqarli chiqibdi☝️
https://openai.com/index/scaling-postgresql/
Maqola juda qiziqarli chiqibdi☝️
OpenAI
Scaling PostgreSQL to power 800 million ChatGPT users
An inside look at how OpenAI scaled PostgreSQL to millions of queries per second using replicas, caching, rate limiting, and workload isolation.
This media is not supported in your browser
VIEW IN TELEGRAM
This is what Android for PC looks like.
The interface of Aluminum OS (the codename for Google's new desktop OS) was accidentally revealed online. One user shared a screencast for a Chrome bug report, recording it on the new OS.
This Android for PC is expected to combine Android and Chrome OS. Official details from Google are expected in May.
🤔 Android meets Chrome (again) More Info: Aluminum OS
The interface of Aluminum OS (the codename for Google's new desktop OS) was accidentally revealed online. One user shared a screencast for a Chrome bug report, recording it on the new OS.
This Android for PC is expected to combine Android and Chrome OS. Official details from Google are expected in May.
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from Sozogram
Media is too big
VIEW IN TELEGRAM
new 2 movie sources added 🔥
Please open Telegram to view this post
VIEW IN TELEGRAM