LeetCode/Kotlin | Easy(32)
-
[LeetCode/Kotlin]Easy - 169. Majority Element
Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 문제 Given an array nums of size n, return the majority element. The majority element is the element that a..
2023.06.30 -
[LeetCode/Kotlin]Easy - 217. 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 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints: 1
2023.06.10 -
[LeetCode/Kotlin]Easy - 66. Plus One
Plus One - LeetCode Can you solve this real interview question? Plus One - You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to- leetcode.com 문제 You are given a large integer represented as an integer array digits, where each digits[i] is the ith dig..
2023.06.10 -
[LeetCode/Kotlin]Easy - 9. Palindrome Number
Palindrome Number - LeetCode Can you solve this real interview question? Palindrome Number - Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Ex leetcode.com 문제 Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 12..
2023.06.10 -
[LeetCode/Kotlin]Easy - 290. Word Pattern
Word Pattern - LeetCode Can you solve this real interview question? Word Pattern - Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s. Example leetcode.com 문제 Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such ..
2023.06.05 -
[LeetCode/Kotlin]Easy - 1470. Shuffle the Array
Shuffle the Array - LeetCode Can you solve this real interview question? Shuffle the Array - Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 O leetcode.com 문제 Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the ..
2023.06.05