Assalomu aleykum!
Mening ismim Hojimurod.
Ayni damda men IT sohasida Java va .NET backend dasturchi sifatida o'z faoliyatimni olib boryapman.
Va Albatta shu sohaga oid ma'lumotlari yetkazama!
Agar ma'lumotlarim isga Manfaatli bo'lsa hursandman๐๐๐
Mening ismim Hojimurod.
Ayni damda men IT sohasida Java va .NET backend dasturchi sifatida o'z faoliyatimni olib boryapman.
Va Albatta shu sohaga oid ma'lumotlari yetkazama!
Agar ma'lumotlarim isga Manfaatli bo'lsa hursandman๐๐๐
Do'stlar biz albatta algoritmik masalalarsiz Dasturlashni tasavvur eta olmaymiz.
Unda "ODOP"(One Day One Problem) Challangeda qatnashamiz degan umidda har kuni Leetcodedan bitta masalani tanlab olamiz!
Unda "ODOP"(One Day One Problem) Challangeda qatnashamiz degan umidda har kuni Leetcodedan bitta masalani tanlab olamiz!
Unda boshladik!
Sana: 03.08.2024
Mavzu: Array
Masala:
https://leetcode.com/problems/two-sum/description/
Sana: 03.08.2024
Mavzu: Array
Masala:
https://leetcode.com/problems/two-sum/description/
LeetCode
Two Sum - LeetCode
Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may notโฆ
You may assume that each input would have exactly one solution, and you may notโฆ
Assalomu aleykum!
Bugungi Leetcode kunlik masalasi: https://leetcode.com/problems/minimum-time-difference/?envType=daily-question&envId=2024-09-16
Va men uni yechgan holda birinchi olovchamni qo'lga kiritdim.
Bugungi Leetcode kunlik masalasi: https://leetcode.com/problems/minimum-time-difference/?envType=daily-question&envId=2024-09-16
Va men uni yechgan holda birinchi olovchamni qo'lga kiritdim.
LeetCode
Minimum Time Difference - LeetCode
Can you solve this real interview question? Minimum Time Difference - Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list.
Example 1:
Input: timePoints = ["23:59"โฆ
Example 1:
Input: timePoints = ["23:59"โฆ
Solution On C# :
public class Solution {
public int FindMinDifference(IList<string> timePoints) {
int[] c = new int[timePoints.Count];
int k = 0;
foreach(var time in timePoints){
string[] a = time.Split(':');
int b = Int32.Parse(a[0]) * 60 + Int32.Parse(a[1]);
c[k] = b;
k++;
}
Array.Sort(c);
int min = Int32.MaxValue;
for(int i = 0;i < c.Length- 1;i++)
{
for(int j = i + 1;j < c.Length;j++){
int min1 = Math.Abs(c[i] - c[j]);
int min2 = c[i] + 1440 - c[j];
if(min > min1){
min = min1;
}
if(min > min2){
min = min2;
}
}
}
return min;
}
}๐ฅ2
Assalomu aleykum!
Bugungi Kunlik masala Easy darajada ekan.
Bizi ham o'ylashdimi deymana๐๐๐
https://leetcode.com/problems/uncommon-words-from-two-sentences/description/?envType=daily-question&envId=2024-09-17
Bugungi Kunlik masala Easy darajada ekan.
Bizi ham o'ylashdimi deymana๐๐๐
https://leetcode.com/problems/uncommon-words-from-two-sentences/description/?envType=daily-question&envId=2024-09-17
LeetCode
Uncommon Words from Two Sentences - LeetCode
Can you solve this real interview question? Uncommon Words from Two Sentences - A sentence is a string of single-space separated words where each word consists only of lowercase letters.
A word is uncommon if it appears exactly once in one of the sentencesโฆ
A word is uncommon if it appears exactly once in one of the sentencesโฆ
public class Solution {
public string[] UncommonFromSentences(string s1, string s2) {
string s = s1 + " " + s2;
string[] a = s.Split(' ');
string z = String.Empty;
for(int i = 0;i < a.Length;i++)
{
bool k = false;
for(int j = 0;j < a.Length;j++)
{
if(i != j && a[i].Equals(a[j]))
{
k = true;
break;
}
}
if(!k){
z += " " + a[i].ToString();
}
}
string[] str;
if(string.IsNullOrWhiteSpace(z.Trim()))
{
str = new string[0];
}else
{
str = z.Trim().Split(" ");
}
return str;
}
}#Leetcode
Solution of Day Problem in Leetcode. It is for You.Read and Learn!
๐2
HashMap haqida maqola yozdim
Uning ortidagi nazariya va zamonaviy dasturlash tillaridagi implementatsiyalari haqida batafsil oโqishingiz mumkin.
Link: https://asadullo.com/blog/hashing/
@solvemproblr
Uning ortidagi nazariya va zamonaviy dasturlash tillaridagi implementatsiyalari haqida batafsil oโqishingiz mumkin.
Link: https://asadullo.com/blog/hashing/
@solvemproblr
Asadullo aka tomonidan yozilgan bu maqolani o'qib chiqdim.
It is Perfect!
Bir marotaba o'qiysiz va HashMap ning yaratilish tarixi va uni qurishdagi asosiy g'oyalarni va o'zi HashMap qanday muammolrga yechim bo'la olishini tushunib olasiz.
Faqat HashMap Funksiyalarini o'rganib uni o'zingiz yoqtirgan dasturlash tilida implment qilish qoladi xolos!
It is for You!
Read and Learn!
It is Perfect!
Bir marotaba o'qiysiz va HashMap ning yaratilish tarixi va uni qurishdagi asosiy g'oyalarni va o'zi HashMap qanday muammolrga yechim bo'la olishini tushunib olasiz.
Faqat HashMap Funksiyalarini o'rganib uni o'zingiz yoqtirgan dasturlash tilida implment qilish qoladi xolos!
It is for You!
Read and Learn!
Do'stlar bugun bir Companiyaning Algoritmik interview siga qatnashdim.
2 soat vaqt va 4 ta masala.
Qariyb 2 tasini ishlay oldim.
Bu masalalar haqida albatta post qilaman. Inn Shaa Allah.
Tushunib yetyapmanki IT olami juda keng. Bir tomonda Project qilayotgan bo'lsang bir , tomonda Algoritmik masala ishlashing kerak. Va ularning bari senga zavq bag'ishlaydi.
Alloh ilmimizni ziyoda qilsin. Amiiyn.
2 soat vaqt va 4 ta masala.
Qariyb 2 tasini ishlay oldim.
Bu masalalar haqida albatta post qilaman. Inn Shaa Allah.
Tushunib yetyapmanki IT olami juda keng. Bir tomonda Project qilayotgan bo'lsang bir , tomonda Algoritmik masala ishlashing kerak. Va ularning bari senga zavq bag'ishlaydi.
Alloh ilmimizni ziyoda qilsin. Amiiyn.
๐1
Assalomu aleykum Hammaga xarli tong.
Demak kunimizni Leetcode Day problem bilan boshlaymiz. Qiyinchilik darajasi middle ekan bugun:
https://leetcode.com/problems/largest-number/description/?envType=daily-question&envId=2024-09-18
Demak kunimizni Leetcode Day problem bilan boshlaymiz. Qiyinchilik darajasi middle ekan bugun:
https://leetcode.com/problems/largest-number/description/?envType=daily-question&envId=2024-09-18
LeetCode
Largest Number - LeetCode
Can you solve this real interview question? Largest Number - Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
Since the result may be very large, so you need to return a string instead of an integer.โฆ
Since the result may be very large, so you need to return a string instead of an integer.โฆ
middle darajadagi misolni yechish oson emas ekan do'stlar fikrlaringizni kutib qolaman qariyb 1 soatdan beri shu masala bilan bandman.
LeetCode
Largest Number - LeetCode
Can you solve this real interview question? Largest Number - Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
Since the result may be very large, so you need to return a string instead of an integer.โฆ
Since the result may be very large, so you need to return a string instead of an integer.โฆ
BUgungi masalaning yechimini sizlar bilan ulashmoqchiman.
It is for You.
Read and Learn!
public class Solution {
public string LargestNumber(int[] nums) {
string[] a = new string[nums.Length];
///Maqsad barcha nums larni stringga o'tkazib olish
for (int i = 0; i < nums.Length; i++)
{
a[i] = nums[i].ToString();
}
int[] b = new int[nums.Length];// maqsad elementlarni "katta" dan "kichik" ka tomoon saqlab borish
int k = 0;//it is b index
int max = 0;///Maqsad sonlar ichidan en "katta" sini aniqlab olib maxda saqlash
bool isEnterIf = false;// Bu "katta" elementlarni b massivga joylash jarayonida bning indexini ko'tarishga ruxsat. Yani keyingi katta elementni qidirishga ruxsat
int index = -1;//Bu ayni jarayondagi 'katta' elementning indeksi
bool isEqualNumbreLength = true;// sonlarni solishtirish jarayonida xonalar soni xar hil bo'lsa bishqa logika va bir xil bo'lsa boshqa logikadan borishga yo'l
// Berilgan sonlarni eng avval 9 bilan boshlanganlarini keyin 8 ... kabi qilib b ga joylashtirish
for (int i = 9; i > 0; i--)
{
for (int j = 0; j < nums.Length; j++)
{
//"katta" element olingandan so'ng u keyingi katta elementni olishga halaqit bermasligi lozim;
if (nums[j] == 0)
{
continue;
}
if (max.ToString().Length != a[j].Length && max != 0 && a[j].StartsWith(i.ToString()))
{
///uzuliklari teng bo'lmagan holat uchun ikkki sonning qaysi birinchisini "katta" ligini aniqlash
long nummax = (long)Convert.ToDouble(a[j].ToString() + max.ToString());
long maxnum = (long)Convert.ToDouble(max.ToString() + a[j].ToString());
if (maxnum > nummax)
{
continue;
}
else
{
max = nums[j];
index = j;
}
isEnterIf = true;
}
///uzuliklar teng bo'lgan holatda "katta" sonni aniqlash
if (a[j].StartsWith(i.ToString()))
{
if (max < nums[j])
{
max = nums[j];
index = j;
isEnterIf = true;
}
}
}
if (isEnterIf && max != 0)
{
i++;
b[k] = max;
max = 0;
nums[index] = 0;
k++;
}
}
///Massivdagi barcha stringlarni qo'shib bizga response etringni yani "eng katta sonni" aniqlash algoritmi;
string response = "";
for (int i = 0; i < b.Length; i++)
{
response += b[i].ToString();
}
//Agar massiv faqat 0 sonidan iborat bo'lsa "000...0" emas "0" qaytarishimiz lozim shuning algoritmi
if(response.Length > 0 && response.Replace("0", "") == ""){
return 0.ToString();
}
return response;
}
}It is for You.
Read and Learn!
LeetCode
Largest Number - LeetCode
Can you solve this real interview question? Largest Number - Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
Since the result may be very large, so you need to return a string instead of an integer.โฆ
Since the result may be very large, so you need to return a string instead of an integer.โฆ
Do'stlar men ikki soat davomida 85 qator code yozib ishlagan masalamni bitta Professional bro Lambda Expression bilan roppa - rosa 5 barobar kam yani 17 qator bilan ishlab qo'yibdilar๐ฑ.
Yomon alam qiladi-a!
Lekin bu usulni ham o'rganib oldim juda zo'r usul ekan bitta logika va hammasi tamom.
Marhamat do'stlar sizlar uchun o'sha brodan "java" dasturlash tilidagi yechim:
https://leetcode.com/problems/largest-number/solutions/5785445/beats-99-best-solution-simplified-easy-approach-all-languages/
Yomon alam qiladi-a!
Lekin bu usulni ham o'rganib oldim juda zo'r usul ekan bitta logika va hammasi tamom.
Marhamat do'stlar sizlar uchun o'sha brodan "java" dasturlash tilidagi yechim:
https://leetcode.com/problems/largest-number/solutions/5785445/beats-99-best-solution-simplified-easy-approach-all-languages/
LeetCode
Largest Number - LeetCode
Can you solve this real interview question? Largest Number - 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.