LeetCode Çözümlerİ – 14. Longest Common Prefix

LeetCode içerisinde bulunan “Longest Common Prefix” sorusunun açıklaması ve çözümü. Bu soruda verilen string’lerin hepsinde ortak olan en uzun ön ek’i bulmanız isteniyor.

🔥 LeetCode 14. Longest Common Prefix: https://leetcode.com/problems/longest-common-prefix/

➡️ Problem açıklaması:

Write a function to find the longest common prefix string amongst an array of strings.

If there is no common prefix, return an empty string “”.

Example 1:

Input: strs = [“flower”,”flow”,”flight”]

Output: “fl”

Example 2:

Input: strs = [“dog”,”racecar”,”car”]

Output: “”

Explanation: There is no common prefix among the input strings.

Constraints:

0 <= strs.length <= 200

0 <= strs[i].length <= 200

strs[i] consists of only lower-case English letters.

LeetCode Çözümlerİ – 141. Linked List Cycle

LeetCode içerisinde bulunan “Linked List Cycle” sorusunun açıklaması ve çözümü. Bu soruda head’i verilen bir linked list’in, içerisinde döngüsel bir yapı olup olmadığı soruluyor. Sorunun çözümü biraz karmaşık gelebilir bazı arkadaşlar için, o yüzden görseller ile de anlatmaya çalıştım, umarım anlaşılabilmişimdir.

🔥 LeetCode 141. Linked List Cycle: https://leetcode.com/problems/linked-list-cycle/

➡️ Problem açıklaması:

Given head, the head of a linked list, determine if the linked list has a cycle in it.

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail’s next pointer is connected to. Note that pos is not passed as a parameter.

Return true if there is a cycle in the linked list. Otherwise, return false.

Example 1:

Input: head = [3,2,0,-4], pos = 1

Output: true

Explanation: There is a cycle in the linked list, where the tail connects to the 1st node (0-indexed).

Example 2:

Input: head = [1,2], pos = 0

Output: true

Explanation: There is a cycle in the linked list, where the tail connects to the 0th node.

Example 3:

Input: head = [1], pos = -1

Output: false

Explanation: There is no cycle in the linked list.

Constraints:

The number of the nodes in the list is in the range [0, 104].

-105 lessEqual Node.val lessEqual 105

pos is -1 or a valid index in the linked-list.

Follow up: Can you solve it using O(1) (i.e. constant) memory?

LeetCode Çözümlerİ – 1221. Split a String in Balanced Strings

LeetCode içerisinde bulunan “Split a String in Balanced Strings” sorusunun açıklaması ve çözümü. Bu soruda verilen string’i en fazla kaç adet dengeli (R ve L harfleri sayısı eşit) string’e ayırabileceğiniz soruluyor.

🔥 LeetCode 1221. Split a String in Balanced Strings: https://leetcode.com/problems/split-a-string-in-balanced-strings/

➡️ Problem açıklaması:

Balanced strings are those who have equal quantity of ‘L’ and ‘R’ characters.

Given a balanced string s split it in the maximum amount of balanced strings.

Return the maximum amount of splitted balanced strings.

Example 1:

Input: s = “RLRRLLRLRL”

Output: 4

Explanation: s can be split into “RL”, “RRLL”, “RL”, “RL”, each substring contains same number of ‘L’ and ‘R’.

Example 2:

Input: s = “RLLLLRRRLR”

Output: 3

Explanation: s can be split into “RL”, “LLLRRR”, “LR”, each substring contains same number of ‘L’ and ‘R’.

Example 3:

Input: s = “LLLLRRRR”

Output: 1

Explanation: s can be split into “LLLLRRRR”.

Example 4:

Input: s = “RLRRRLLRLL”

Output: 2

Explanation: s can be split into “RL”, “RRRLLRLL”, since each substring contains an equal number of ‘L’ and ‘R’

Constraints:

1 <= s.length <=1000

s[i] = ‘L’ or ‘R’

İstanbul Maratonunda 10 KM Koştum!

Dün İstanbul maratonunun 10 KM olanını İBB Maltepe Sahil Spor Tesislerinde tamamladım. Öncelikle bu tesisleri çok beğendimi söylemek isterim. Koşu parkuru gayet güzel ve bakımlı. Girişte sadece eNabız üzerinden grip aşısı riskinizin olmaması gerekiyor şu andaki koronavirüs nedeniyle.

Bu videoda neden koştuğumu ve koşmanın benim açımdan ne kadar önemli olduğunu ve neden herkese tavsiye ettiğimi anlatmaya çalıştım.

Teşekkürler @İBBSporİstanbul

🏃‍♂️🏃‍♂️ Koşmaya başlayacaklara faydalı linkler:

➡️ https://www.runnersworld.com/uk/training/beginners/a772727/how-to-start-running-today/

➡️ https://www.reddit.com/r/coolguides/comments/a4dwil/how_to_start_running/

➡️ https://www.reddit.com/r/running/comments/37yx5y/things_that_have_helped_me_as_a_beginning_runner/

LeetCode Çözümlerİ – 482. License Key Formatting

LeetCode içerisinde bulunan “License Key Formatting” sorusunun açıklaması ve çözümü. Bu soruda verilen string’i bir lisans key formatında yazdırmanız isteniyor. Sorunun açıklaması biraz garip, o yüzden pek takılmayın bence buna.

🔥 LeetCode 482. License Key Formatting: https://leetcode.com/problems/license-key-formatting/

➡️ Problem açıklaması:

You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes.

Given a number K, we would want to reformat the strings such that each group contains exactly K characters, except for the first group which could be shorter than K, but still must contain at least one character. Furthermore, there must be a dash inserted between two groups and all lowercase letters should be converted to uppercase.

Given a non-empty string S and a number K, format the string according to the rules described above.

Example 1:

Input: S = “5F3Z-2e-9-w”, K = 4

Output: “5F3Z-2E9W”

Explanation: The string S has been split into two parts, each part has 4 characters. Note that the two extra dashes are not needed and can be removed.

Example 2:

Input: S = “2-5g-3-J”, K = 2

Output: “2-5G-3J”

Explanation: The string S has been split into three parts, each part has 2 characters except the first part as it could be shorter as mentioned above.

Note:

The length of string S will not exceed 12,000, and K is a positive integer.

String S consists only of alphanumerical characters (a-z and/or A-Z and/or 0-9) and dashes(-).

String S is non-empty.

LeetCode Çözümlerİ – 392. Is Subsequence

LeetCode içerisinde bulunan “Is Subsequence” sorusunun açıklaması ve çözümü. Verilen stringlerden birinin, diğerinin subsequence’ı olup olmadığını bulmanız isteniyor. “Subsequence”‘ı soruda; uzun olan string’ten belirli sayıda (veya hiç) karakterler silinerek, kalan harflerin sırası değiştirilmeden elde edilebilen bir string ise true, değilse false döndürmeniz isteniyor.

🔥 LeetCode 392. Is Subsequence: https://leetcode.com/problems/is-subsequence/

➡️ Problem açıklaması:

Given a string s and a string t, check if s is subsequence of t.

A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, “ace” is a subsequence of “abcde” while “aec” is not).

Follow up:

If there are lots of incoming S, say S1, S2, … , Sk where k greaterEqualThan 1B, and you want to check one by one to see if T has its subsequence. In this scenario, how would you change your code?

Example 1:

Input: s = “abc”, t = “ahbgdc”

Output: true

Example 2:

Input: s = “axc”, t = “ahbgdc”

Output: false

Constraints:

0 lessEqualThan s.length lessEqualThan 100

0 lessEqualThan t.length lessEqualThan 10^4

Both strings consists only of lowercase characters.

LeetCode Çözümlerİ – 118. Pascal’s Triangle

LeetCode içerisinde bulunan “Pascal’s Triangle” sorusunun açıklaması ve çözümü. Bu soruda verilen sayı adedi kadar, pascal üçgeni satırını geriye döndürmeniz isteniyor.

https://tr.wikipedia.org/wiki/Pascal_%C3%BC%C3%A7geni

🔥 LeetCode 118. Pascal’s Triangle: https://leetcode.com/problems/pascals-triangle/

➡️ Problem açıklaması:

Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.

In Pascal’s triangle, each number is the sum of the two numbers directly above it.

Example:

Input: 5

Output:

[[1],

[1,1],

[1,2,1],

[1,3,3,1],

[1,4,6,4,1]]

LeetCode Çözümlerİ – 344. Reverse String

Leetcode içerisinde bulunan “Reverse String”‘ sorusunun açıklaması ve çözümü. Bu soruda karakter dizisi olarak verilen string’in ekstra bir alan kullanmadan tersine çevirmeniz isteniyor.

🔥 LeetCode 344. Reverse String: https://leetcode.com/problems/reverse-string/

➡️ Problem açıklaması:

Write a function that reverses a string. The input string is given as an array of characters char[].

⚠️ Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.

You may assume all the characters consist of printable ascii characters.

Example 1:

Input: [“h”,”e”,”l”,”l”,”o”]

Output: [“o”,”l”,”l”,”e”,”h”]

Example 2:

Input: [“H”,”a”,”n”,”n”,”a”,”h”]

Output: [“h”,”a”,”n”,”n”,”a”,”H”]

➡️ Two Pointer tekniği: https://www.geeksforgeeks.org/two-pointers-technique/

Yazılımcılara Kİtap Önerİlerİ – Fuji Dağını Nasıl Taşırsınız?

Bu videoda yazılım geliştiricilere önerebileceğim kitap William Poundstone’un Odtü Yayınevi’nden çıkan “Fuji Dağını Nasıl Taşırsınız?”. Kitap temel olarak, size sorulan aldatıcı veya bulmacalı sorulara nasıl yaklaşım göstermeniz gerektiğine dair bilgiler veriyor. Okuması da gayet keyifli.

➡️ Kitap Tanıtımı:

💡 Neden kanalizasyon kapakları kare değil de daire biçimindedir?

💡 Neden bira kutularının altı ve üstü, ortasından daha dardır?

💡 Dünyada kaç tane piyano akortçusu vardır?

💡 Aynadaki bir görüntüde neden ‘yukarı ile aşağı’ yer değiştirmez de ‘sağ ile sol’ yer değiştirir?

Microsoft ve diğer ileri teknoloji şirketleri, zorlukları dillere destan iş görüşmelerinde yıllardır bunlara benzer bulmaca ve bilmeceler soruyorlar.

“Bulmacalı mülakat”, günümüzde giderek yaygınlaşan bir moda. Wall Street’ten Silikon Vadisi’ne, birçok farklı alanda işverenler bugünün aşırı rekabetçi küresel pazarında ayakta kalabilmek için gerekli olan zekâ, yaratıcılık ve problem çözme becerisi gibi özellikleri ölçmek için adaylara zor ve hileli sorular soruyorlar.

Fuji Dağı’nı Nasıl Taşırsınız?, iş dünyasında yer alan herkes için vazgeçilmez bir kitap. Birçok aday arasından en yetenekli elemanları bulmak isteyen yöneticiler bulmacalı mülakat hazırlamanın yollarını öğrenecekler. İş arayanlar, belki de hayatlarının işine ulaşma yolunda en çetin sorularla bile nasıl baş edebileceklerini öğrenme fırsatını elde edecekler.

Zekâ bulmacası meraklıları ise, bu kitapta pek çok yaratıcı ve orijinal soru ile bunların yanıtlarını bulacaklar…

💊 Sayfa Sayısı: 259

💊 Baskı Yılı: 2005

💊 Yayınevi: Odtü

💊 İlk Baskı Yılı : 2005

💊 Dil : Türkçe

➡️ Kitabın Bölümleri

1️⃣ Çözümü imkansız soru

2️⃣ Termanlar ve Silikon Vadisi

3️⃣ Bill Gates ve Bulmaca Kültürü

4️⃣ Microsoft Mülakat Bulmacaları

5️⃣ İpucundan Yoksunluğu Kabullenmek

6️⃣ Wall Street ve Stres Mülakatı

7️⃣ En zor mülakat soruları

8️⃣ Bulmacalı mülakatın üstesinden gelmenin yolları

9️⃣ Yeniliğe dayalı şirketler nasıl mülakat yapmalı

Yazılımcının Özgeçmİşİnde Olması Gereken Becerİler

Videoda kendi tecrübelerimden ve internetten öğrendiğim kadarıyla yazılımcının özgeçmişinde bulunması gereken “beceri listesini” anlatmaya çalıştım. Bir yazılımcının özgeçmişinde hangi beceriler bulunabilir ve bunları nasıl listeleyebilir, bu videoda bunları bulacaksınız.

Günümüzde işe alım yapısını ve işe almanın nasıl yapıldığını anlamak neredeyse o pozisyon için geliştirilen yetenekler ve beceriler kadar önemli bir hal aldı.

İşe alım yapan kişiler bir pozisyon açmadan önce o pozisyonun bağlı olduğu yönetici veya karar verici kişi ile iletişime geçip (günümüzde artık teknik kişiler de adayın işe alım süreci boyunca katılım sağladıkları da oluyor) bu gerekli bilgileri edinirler.

Genel olarak bu becerileri 3 kısımda toplayabiliriz;

✔️ Sahip olunması gereken beceriler

✔️ “Nice to have” beceriler

✔️ Özel beceriler

➡️ Sahip olunması gereken beceriler: En temelinde, işe alındığınızda temel olarak gününüzün çoğunda kullanacağınız özelliklerdir bunlar. İlgili teknik alanda bir derece, kullandığınız programlama dili ve teknolojilerde sahip olduğunuz deneyimleri içerir.

➡️ “Nice to have” beceriler: İşe alınma sürecinde olan aday ile doğrudan alakalı olmayıp, çalıştığı projenin başka bileşenlerinde gerekli olabilecek ikinci bir programlama dili veya teknolojilerle ilgili deneyim ve/veya aşinalık içerirler. Bunlara ek olarak “iyi bir takım oyucusu olmak” ve “açık iletişim” gibi soft özelliklerin de burada ayrı bir önemi vardır.

➡️ Özel beceriler: Bunlara tam olarak “elde edilmezi zor beceriler / deneyimler” diyebiliriz sanırım. Birçok kişi için gerekli görülmez, fakat pozisyon için faydalı olabilir. Tabi “kitap okumak”, “yürüyüş yapmak”, “film izlemek” gibi şeyler buraya ait değildir. Hatta özgeçmişe ait değildir derler bazen bunlar için.

Son olarak, işe alım yapan kişiler “mükemmel aday”ı aramazlar. Onlar “pozisyon için en uygun aday”ı ararlar. Bize düşen bu adaylar arasından özgeçmiş ile birlikte doğru bir şekilde öne çıkmayı başarmaktır.

Bu videoyu hazırlarken faydalandığım kaynaklar şu şekilde;

✔️ How to List Programming Skills on a Resume: https://www.indeed.com/career-advice/resumes-cover-letters/how-to-list-programming-skills-on-resume

✔️ The software developer’s guide to a perfect resume: https://www.careersifu.com/the-software-developer%E2%80%99s-guide-to-a-perfect-resume/

✔️ How to write a killer Software Engineering résumé: https://www.freecodecamp.org/news/writing-a-killer-software-engineering-resume-b11c91ef699d/