ID |
Platform |
Title |
Technology |
Difficulty |
Description |
Official Solutions |
YT |
---|---|---|---|---|---|---|---|
14 | leetcode.com | Length of Last Word | Problem Solving | Very easy | Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. Example 1: Input: s = "Hello World" Output: 5 Explanation: The last word is "World" with length 5. Example 2: Input: s = " fly me to the moon " Output: 4 Explanation: The last word is "moon" with length 4. Example 3: Input: s = "luffy is still joyboy" Output: 6 Explanation: The last word is "joyboy" with length 6. | ||
47 | leetcode.com | Fizz Buzz | Problem Solving | Very easy | Given an integer n, return a string array answer (1-indexed) where: answer[i] == "FizzBuzz" if i is divisible by 3 and 5. answer[i] == "Fizz" if i is divisible by 3. answer[i] == "Buzz" if i is divisible by 5. answer[i] == i (as a string) if none of the above conditions are true. Example 1: Input: n = 3 Output: ["1","2","Fizz"] Example 2: Input: n = 5 Output: ["1","2","Fizz","4","Buzz"] Example 3: Input: n = 15 Output: ["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"] | ||
35 | leetcode.com | Intersection of Two Arrays | Problem Solving | Easy | Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2] Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [9,4] Explanation: [4,9] is also accepted. | ||
33 | leetcode.com | Move Zeroes | Problem Solving | Very easy | Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] | ||
13 | leetcode.com | Remove Duplicates from Sorted Array | Problem Solving | Very easy | Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements. Return k after placing the final result in the first k slots of nums. Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory. Custom Judge: The judge will test your solution with the following code: int[] nums = [...]; // Input array int[] expectedNums = [...]; // The expected answer with correct length int k = removeDuplicates(nums); // Calls your implementation assert k == expectedNums.length; for (int i = 0; i < k; i++) { assert nums[i] == expectedNums[i]; } If all assertions pass, then your solution will be accepted. Example 1: Input: nums = [1,1,2] Output: 2, nums = [1,2,_] Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively. It does not matter what you leave beyond the returned k (hence they are underscores). Example 2: Input: nums = [0,0,1,1,1,2,2,3,3,4] Output: 5, nums = [0,1,2,3,4,_,_,_,_,_] Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively. It does not matter what you leave beyond the returned k (hence they are underscores). | ||
111 | hackerrank.com | HackerRank in a String! | Problem Solving | Easy | ვაბრუნებთ YES/NO სიტყვებს, იმის მიხედვით, შეიცავს თუ არა გადმოცემული string-ი 'hackerrank'-ში შემავალ სიმბოლოებს შესაბამისი თანმიმდევრობით | ||
110 | hackerrank.com | CamelCase | Problem Solving | Easy | გადმოგვცემენ წინადადებას CamelCase ფორმატში, უნდა დავითვალოთ სიტყვების რაოდენობა (CamelCase ფორმატში პირველი სიტყვის პირველი ასო არის lowercase, დანარჩენი სიტყვების შემთხვევაში პირიქით - uppercase-ში) | ||
109 | hackerrank.com | Alternating Characters | Problem Solving | Easy | გადმოგვცემენ string-ს, რომელიც შეიცავს მხოლოდ 'AB' სიმბოლოებს (მაგალითად: 'BBABAAAB', 'AABBAABBB'), უნდა დავაბრუნოთ რიცხვი, თუ რამდენჯერ მოგვიწევს სიმბოლოს წაშლა, რომ მივიღოთ ისეთი string-ი, რომელიც არ შეიცავს AA ან BB substring-ს | ||
117 | hackerrank.com | Mini-Max Sum | Problem Solving | Easy | ხუთრიცხვიან მასივში ვითვლით მინიმალურ და მაქსიმალურ ჯამებს ნებისმიერი ოთხი რიცხვისა | ||
116 | hackerrank.com | Diagonal Difference | Problem Solving | Easy | ვითვლით დიაგონალებზე განთვასებული რიცხვების ჯამების აბსოლუტურ სხვაობას |