Tag Archives: may challange

LeetCode May Challenge – First Unique Character in a String – [Amazon Mülakat Sorusu] 5. GÜN

LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın beşinci gün sorusu “First Unique Character in a String””in açıklaması ve çözümü. LeetCode’a göre Amazon mülakatlarında sorulmuş sorulardan biri.

🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge

➡️ Problem açıklaması:

Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.

Examples:

s = “leetcode” return 0.

s = “loveleetcode”, return 2.

Note: You may assume the string contain only lowercase letters.

LeetCode May Challenge – Number Complement – [Cloudera Mülakat Sorusu] 4. GÜN

LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın dördüncü gün sorusu “Number Complement””ın açıklaması ve çözümü. LeetCode’a göre Cloudera mülakatlarında sorular sorulardan biridir.

🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge

➡️ Problem açıklaması:

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.

Example 1:

Input: 5

Output: 2

Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.

Example 2:

Input: 1

Output: 0

Explanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0.

Note: The given integer is guaranteed to fit within the range of a 32-bit signed integer. You could assume no leading zero bit in the integer’s binary representation.

LeetCode May Challenge – Ransom Note – [Microsoft Mülakat Sorusu] 3. GÜN

LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın üçüncü gün sorusu “Ransom Note””un açıklaması ve çözümü. Leetcode’a göre bu soru Microsoft mülakatlarında sorulan sorulardan biriymiş. #LeetCode #Programlama #Microsoft

🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge

➡️ Problem açıklaması:

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false.

Each letter in the magazine string can only be used once in your ransom note.

Note: You may assume that both strings contain only lowercase letters.

canConstruct(“a”, “b”) — false

canConstruct(“aa”, “ab”) — false

canConstruct(“aa”, “aab”) — true

LeetCode May Challenge – Jewels and Stones – [Amazon ve Adobe Mülakat Sorusu] 2. GÜN

LeetCode’un mayıs ayı için her gün bir programlama sorusu sorduğu “May Challenge”‘ın ikinci gün sorusu “Jewels and Stones””un açıklaması ve çözümü. LeetCode’a göre bu soru Amazon ve Adobe mülakatlarında sorular sorulardan biri.

🔥 LeetCode May Challenge: https://leetcode.com/explore/featured/card/may-leetcoding-challenge

➡️ Problem açıklaması:

You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels.

The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so “a” is considered a different type of stone from “A”.

Example 1:

Input: J = “aA”, S = “aAAbbbb”

Output: 3

Example 2:

Input: J = “z”, S = “ZZ”

Output: 0

Note: S and J will consist of letters and have length at most 50. The characters in J are distinct.