Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Insert Delete GetRandom O(1) - LeetCode
Can you solve this real interview question? Insert Delete GetRandom O(1) - Implement the RandomizedSet class:
* RandomizedSet() Initializes the RandomizedSet object.
* bool insert(int val) Inserts an item val into the set if not present. Returns true if…
* RandomizedSet() Initializes the RandomizedSet object.
* bool insert(int val) Inserts an item val into the set if not present. Returns true if…
⚡1👍1🍾1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Kun masalasi: 1207. Unique Number of Occurrences
Qiyinlik darajasi: Easy
Qiyinlik darajasi: Easy
LeetCode
Unique Number of Occurrences - LeetCode
Can you solve this real interview question? Unique Number of Occurrences - Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.
Example 1:
Input: arr = [1,2,2,1,1,3]
Output:…
Example 1:
Input: arr = [1,2,2,1,1,3]
Output:…
👍1
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Determine if String Halves Are Alike - LeetCode
Can you solve this real interview question? Determine if String Halves Are Alike - You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.
Two strings are alike if…
Two strings are alike if…
image_2022-12-01_09-25-00.png
181.2 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Determine if Two Strings Are Close - LeetCode
Can you solve this real interview question? Determine if Two Strings Are Close - Two strings are considered close if you can attain one from the other using the following operations:
* Operation 1: Swap any two existing characters.
* For example, abcde…
* Operation 1: Swap any two existing characters.
* For example, abcde…
👍4
tg_image_1592388437.jpeg
132.2 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2
Qiziqishingiz mumkin yuqoridagi kodda sort ishlatilgan va nima uchun bu kod ning time complexity si
NLogN emas deb, to’g’ri. Sortlash uchun NLogN. lekin bizdagi array ning hajmi 26 va bu array ni saralash uchun 26*log(26). Lekin, buni hisoblab ko’rsak 200 dan ham kam bu esa const time hisoblanadi. Unda nima uchun O(1) bo’lmadi deb o’ylayotgan bo’lsangiz tepadagi 2 ta so’zlarning uzunligi maximum 10ˆ5 ekanligi berilgan va biz ularni massiv shakliga keltirib to’liq yurib chiqdik bu esa O(N). Shunday qilib: O(N) + O(1) = O(N).👍4
Har bir thread ning o'zining nomi bor(by default). Biz xohlagan threadimiz uchun o'zimiz xohlagan nomni bera olamizmi?
Anonymous Quiz
66%
ha albatta, myThread.setName(“some name”)
34%
yo’q, har bir thread uchun java o'zi nom qo'yadi, masalan Thread-0, Thread-1 …
👍1
Yuqoridagi methoddan bir vaqtda faqat bir thread foylanishini qanday ta'minlasa bo'ladi?
Anonymous Quiz
38%
void kalit so'zi oldidan synchronized kalit so'zini yozish kerak
38%
method nomi oldidan synchronized kalit so'zini yozish kerak
19%
buni method ni o'zgartirish orqali amalga oshirib bo'lmaydi
4%
buni umuman iloji yo'q
Savol: Deadlock nima?
Javobingizni kommentda qoldiring...
Please open Telegram to view this post
VIEW IN TELEGRAM
Biror maqsadga erishish uchun eng asosiy kerak bo’ladigan narsalar:
1. Intention(niyat)
2. Discipline(intizom)
3. Consistency(doimiylik, uzluksizlik)
Majburiy emas, ammo juda katta yordam beradigani esa bu:
Keling birgalikda 14 kunlik Data-Structure study-plan ni o’zimiz uchun challenge qilamiz va har kuni yechimlar bilan bo’lishamiz. Balkim video ko’rinishidagi yechimlar ham ta’minlanar. Birgalikda har kuni taxminan 2 3 ta masala yechish orqali Data Structure ga oid bilimlarimizni oshirib va yangilab olamiz. Ohirida esa badge ga ham ega bo’lamiz.
Telegram: JavaHereBlogs
Youtube: JavaIsHere
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Study Plan - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Keling ertaga, dushanbadan, 2023-yildan emas
Bugundan boshlaymiz yani 3-dekabrdan.
Shior: Let you start today!
Bugundan boshlaymiz yani 3-dekabrdan.
Shior: Let you start today!
👍14
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Sort Characters By Frequency - LeetCode
Can you solve this real interview question? Sort Characters By Frequency - Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.
Return the sorted…
Return the sorted…
⚡1
tg_image_3152687319.jpeg
270.2 KB
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡1
Please open Telegram to view this post
VIEW IN TELEGRAM
LeetCode
Contains Duplicate - LeetCode
Can you solve this real interview question? Contains Duplicate - Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Example 1:
Input: nums = [1,2,3,1]
Output: true…
Example 1:
Input: nums = [1,2,3,1]
Output: true…
⚡1